Generated client cannot distinguish not set and null value #2074
brucegodden
started this conversation in
Ideas
Replies: 1 comment
-
To cause further confusion, it looks like the conversion from the input type to the query input is ignoring any properties set to null, whether explicitly or not. (A common behaviour of Jackson and its ilk.) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a GraphQL mutation for updating an object. I would like to say:
This seems to me to be a reasonable GraphQL API definition. It is fairly straightforward to arrange to obey this behaviour in the implementation of the API.
However, the generated API client does not seem to distinguish between not set and null. Either you have to set a value in the constructor for the input type, presumably null if you don't have an actual value, or the value defaults to null if you don't explicitly set it.
Would it be unreasonable to ask for the generated client to be able to arrange to not include a property in the query input if the user did not specify a value for it? (Possibly only for optional properties.)
Beta Was this translation helpful? Give feedback.
All reactions