Custom Types that are not Graphql scalar types #86
Unanswered
morloderex
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I just added an example for converting a custom input object type, see #87. Apart from an unrelated issue with the test setup, it works as written. However, there are additional complexities when it comes to converting custom object types. For instance, what should we do with a query like this? query Transaction($id: ID!) {
transaction(id: $id) {
amount {
value
# Missing currency
}
}
} I presume that without |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys.
I have an API that provide me with the fallowing type inspection (trimmed down to only the part that is needed):
As you can see when querying this one would have to do something like this:
This is all fine and generates the correct ObjectLike php objects for these type of queries, but I can't figure out how i can change that ObjectLike class to be an entirely custom ObjectLike instead. Sense it would be a long more useful if i was able to convert this object into for instance a Money-PHP/Money instead.
But it seems to me that the examples with custom types is only for scalar types not whole objects which contains scalars? Is this something that would be impossible to do?
Beta Was this translation helpful? Give feedback.
All reactions