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
-
Reading the docs about Scalars, one can see that you can implement
graphql.Marshaler
with the methodUnmarshalGQL
to decode.However, it would be great to mention that
UnmarshalJSON
takes precedence, andUnmarshalGQL
gets 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