Custom scalars and UnmarshalJSON: UnmarshalGQL ignored #2727
geertjanvdk
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Reading the docs about Scalars, one can see that you can implement
graphql.Marshalerwith the methodUnmarshalGQLto decode.However, it would be great to mention that
UnmarshalJSONtakes precedence, andUnmarshalGQLgets ignored. Granted, probably both have to do the same thing (unless crazy stuff like using XML instead of JSON for GraphQL, which is technically possible).Wanted to open a discussion first, maybe I missed a note somewhere. Took me a while to figure out what was happening. Now both methods are implemented, and execute the same decoding.
Beta Was this translation helpful? Give feedback.
All reactions