You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the operation included execution, the response map must contain a first entry with key data. The value of this entry is described in the “Data” section. If the operation failed before execution, due to a syntax error, missing information, or validation error, this entry must not be present.
If the operation encountered any errors, the response map must contain a next entry with key errors. The value of this entry is described in the “Errors” section. If the operation completed without encountering any errors, this entry must not be present.
So ExecutionResult is a map like thing that should NOT have an error field if there are no errors and vice versa.
What would happened if execustionResult returns null when error is empty?
Is there any convention in JSON libraries what happens? I know that in GSON it ignores the null values (unless specific asked not to)
Activity
guy120494 commentedon May 30, 2017
What would happened if execustionResult returns null when error is empty?
Is there any convention in JSON libraries what happens? I know that in GSON it ignores the null values (unless specific asked not to)
bbakerman commentedon May 31, 2017
So the spec says that if null is present and there are no errors then that is the result of the query
So graphql JSON encoder code is responsible for setting it up to encode nulls if it wants to follow spec
andimarek commentedon Jun 18, 2017
See PR #480 for further discussion
execution result to spec
execution result to spec
tkvw commentedon Aug 22, 2017
Why didn't you implement a custom serialization
type for this? @see: https://github.com/google/gson/blob/master/UserGuide.md#TOC-Custom-Serialization-and-Deserialization
bbakerman commentedon Aug 24, 2017
Because the graphql-java library BY design does not want to get into the game of build JSON serialisation strategies
Would we would need one for Jackson / GSON / JSONP / Java 9 / SimpleJson ....