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
{{ message }}
Repository navigation
Introspection on default value for input object is not following GraphQL spec #296
I defined an input object with a HashMap as default value. Introspection on the default value gives the toString() value of the HashMap (see graphql.introspection#__InputValue). However, GraphQL specification requires the string to be encoded using GraphQL language.
As a result, GraphiQL would fail because of the incorrect introspection result.
Activity
GH graphql-java#296: Failing test
dminkovsky commentedon Jan 12, 2017
Thank you for the report!
Here's a failing test: https://github.com/graphql-java/graphql-java/pull/297/files#diff-79600ba7380fb4f5a886ef11a5cc3aba
dminkovsky commentedon Jan 13, 2017
bbakerman commentedon Apr 21, 2017
I looked into this further. It does today do the wrong thing but the expected result linked here is not correct I don't think
The spec says is should be a field called "defautValue" and a graphql language encoded "String representation".
Looking at the reference implementation they do this
https://github.com/graphql/graphql-js/blob/master/src/type/introspection.js
This takes the input default value object and the logical graphql type and reverse runs it back though AST and then an AST printer.
We dont yet have an AST printer
There is a PR : #386 that provides a runtime type printer. But not a printer of AST values
The AST vales in graphql-java are represented by classes such as graphql.language.IntValue and graphql.language.StringValue etc..
In order to fix this to spec we would have to write a AST printer and then reimplement the astFromValue method mentioned above.
I will see if I can get this done
graphql-java#296 - added a AST pretty printer system so I can fix oth…
graphql-java#296 -more tests for extra conditions
graphql-java#296 - now with an AST from object support and tests
Merge remote-tracking branch 'upstream/master'