-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
The Docs link display continuous loading image when clicked #212
Comments
Hi @vikram9r - Doc Explorer shows a loading spinner when there is no schema passed in/defined by the fetcher function. Is there a code snippet I can take a look to help you further? |
This is the java resource which would accept the graphql query as a string
|
Hi @asiandrummer can you suggest me on about how the GraphQL server implementation should be? could you please check above code and help me Thank you! |
@vikram9r - it's hard to help with the code you provided unfortunately; how are you mounting GraphiQL? You'd need to pass in a fetcher function to further execute the queries with. Could you show me how you're creating the web page with GraphiQL in it? |
Hi @asiandrummer - thank you for the response !
In the above code the file paths for graphiql.js and graphiql.css are the files which i have copied from node_modules folder of npm |
Ok, the code looks ok to me as it looks mostly of the GraphiQL example code. When it's mounted for the first time, GraphiQL tries to send an introspection query to the server, and I think that's the step failing for you. I'd advise to check if the introspection query is correctly sent what the app is loaded. FYI this snippet is how we ensure the schema is available when the component gets mounted, which is also where the introspection is done. |
Please be noted that I am not using Node.js for server implementation rather I am using java https://github.com/bpatters/schemagen-graphql |
When introspection fails to load a schema (or a schema is intentionally excluded via providing `null` as the prop), the doc explorer currently continues to show a loading indicator. This change alters that behavior to instead declare that no schema exists. This also ensures schema is set to `null` after failure to load via introspection. Fixes #212
Hey @vikram9r - This state can occur in two ways:
I've added a change which makes errors loading the schema more clear in GraphiQL doc explorer so at least you would know the difference between continuing to wait for the introspection result vs that resulting in an error. |
When introspection fails to load a schema (or a schema is intentionally excluded via providing `null` as the prop), the doc explorer currently continues to show a loading indicator. This change alters that behavior to instead declare that no schema exists. This also ensures schema is set to `null` after failure to load via introspection. Fixes #212
@vikram9r Wrapping the json response from graphql server with |
Ah good to know. Just curious what server implementation you're using? Queries should always have the "data" field as defined by the spec. It might be helpful to report a bug. |
@leebyron I was writing my own simple implementation but I was ignorant of the spec. Thank you for your feedback. |
Cool :) |
@bencooling Thank you! Spent a lot of time trying to figure out what was the issue. |
I have implemented GraphQL server using java, the sever is able to listen and respond to the the query requests but when i first request the GraphiQL in browser the the introspection response json was being displayed in the GraphiQL response window and when I click the Docs link I see the continuous loading image.
The other graphql requests which I send from the GraphiQL request editor are working fine and I can even see the response back displaying in the GraphiQL response window
Note
I am using https://github.com/graphql/graphiql/blob/master/example/index.html in my application resources to load the GraphiQl from my server.
The text was updated successfully, but these errors were encountered: