-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feedback for “Running an Express GraphQL Server” #1951
Comments
It sounds like you need to submit a query; try replacing the query text (the big text box on the left) with |
I don't think I follow. Copying this text, getting the "Running a GraphQL API server at http://localhost:4000/graphql" notice in the terminal, opening that link in a browser, and I get the error above. Code (exactly from the documentation):
Which part gets replaced? Should I be opening this in another server application like Apollo? |
Ah; thank you for expanding! You are now running a GraphQL API at http://localhost:4000/graphql - but this is an API designed to be queried by computer tools (rather than just visiting it in a web browser). You can spin up
This will give you the GraphiQL IDE which you can then write GraphQL queries in. (A similar instruction that would also work can be seen in the graphql-http README: https://github.com/graphql/graphql-http#serve-graphiql ) |
Now I come to look at the webpage: https://graphql.org/graphql-js/running-an-express-graphql-server/ I can see how we can improve the content. You followed the instructions, ran the server, and then expected to be able to do something - this is a reasonable expectation! But to actually use the GraphQL you need a GraphQL client, which the tutorial then goes on to talk about. I'll make an edit to that page to clarify - thanks a lot for the feedback! |
Here's a PR to improve the flow in the documentation - thanks again for the feedback @mitchelln11! |
See graphql/graphql.github.io#1951 For someone following the tutorial they may well get as far as running the server (`node server.js`) and then attempt to visit their new API and get confused because they're met with an error such as `{"errors":[{"message":"Missing query"}]}`. This PR adds some joining text to make it clear this is the expected outcome, and they must read on to get the GraphiQL IDE set up so that they can write queries.
All I'm getting in the browser is this message. Server technically starts, but I just get the error on the front-end.
Dependencies are installed. Followed step by step. Same response from the
Express
and theruru
server for GraphiQLThe text was updated successfully, but these errors were encountered: