-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slash graphql introspection query fails with apollo client #5792
Comments
Hi @martaver. Thanks for the bug. I think I was able to boil this down to a much simpler example. I've marked this as accepted, and we'll be looking at a fix for this. curl -vH "Content-Type: application/json" -d '{"operationName":"IntrospectionQuery","variables":{},"query":"query IntrospectionQuery {\n __schema {\n queryType {\n name\n __typename\n }\n mutationType {\n name\n __typename\n }\n subscriptionType {\n name\n __typename\n }\n types {\n ...FullType\n __typename\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n __typename\n }\n __typename\n }\n __typename\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n __typename\n }\n type {\n ...TypeRef\n __typename\n }\n isDeprecated\n deprecationReason\n __typename\n }\n inputFields {\n ...InputValue\n __typename\n }\n interfaces {\n ...TypeRef\n __typename\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n __typename\n }\n possibleTypes {\n ...TypeRef\n __typename\n }\n __typename\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n __typename\n }\n defaultValue\n __typename\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\n"}' https://smiling-jeans-9473.us-east-1.aws.thegaas.com/graphql |
Btw, if I paste the introspection query into the API Explorer on the web UI, I get the introspection JSON displayed correctly. |
Okay, I was able to get the introspection working using a simpler axios request. Still scratching my head about what's special about the apollo client query... formatting maybe? |
I was able to reproduce this on Dgraph. It likely happens because |
… introspection queries (hypermodeinc#5827) There was a missing " in the __typename that was filled in for types in schema introspection queries. That resulted in JSON parsing errors, we have fixed it and modified the existing test to test for it. Fixes hypermodeinc#5792.
I'm testing Slash GraphQL, and I'm using Apollo Client to send an introspection query to my /graphql instance.
Getting the introspection JSON is important because it allows us to codegen in the front-end.
However, when I run the introspection query with the /graphql instance, I get the following error:
This same introspection query works fine with other graphql servers. I thought it likely that this is an incompatibility on dgraph's behalf.
I've set up a reproduction here: https://github.com/cleric-sh/repro/tree/dgraph-introspection
Just clone that repo, switch to the dgraph-introspection branch and do yarn && yarn update.
The text was updated successfully, but these errors were encountered: