Skip to content
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

GraphiQL set up incorrectly according to docs #179

Open
jaa134 opened this issue Jul 31, 2024 · 7 comments
Open

GraphiQL set up incorrectly according to docs #179

jaa134 opened this issue Jul 31, 2024 · 7 comments

Comments

@jaa134
Copy link
Contributor

jaa134 commented Jul 31, 2024

What you were expecting:
Docs clearly say to register your express server handler at /graphql. Then GraphiQL should work once the server starts.

What happened instead:
GraphiQL loads index.html, but fails to fetch schema or make requests. All requests 404 as they are directed at the wrong handler path.

Steps to reproduce:

  1. Register express server handler using /graphql as path like docs say.
  2. Build/start express server.
  3. Open GraphiQL in web browser
  4. Notice that schema cannot be fetched and queries/mutations fail.

Related code:
See:

  • here --> Should be \graphql or configurable to match a custom path
  • here --> Should be removed

More info
GraphiQL is making requests to the wrong express handler due to a misconfiguration. If I register the handler at the base express path /, then it works fine.

Environment
Node

@jaa134
Copy link
Contributor Author

jaa134 commented Jul 31, 2024

@djhi Related to #177

@djhi djhi closed this as completed Jul 31, 2024
@jaa134
Copy link
Contributor Author

jaa134 commented Aug 1, 2024

@djhi Why was this closed? The new GraphiQL handler is still broken.

@djhi djhi reopened this Aug 1, 2024
@djhi
Copy link
Contributor

djhi commented Aug 1, 2024

Read too fast...

@djhi
Copy link
Contributor

djhi commented Aug 1, 2024

You can open PRs by the way :)

@jaa134
Copy link
Contributor Author

jaa134 commented Aug 1, 2024

Doing it now! Give me 2 seconds :)

@jaa134
Copy link
Contributor Author

jaa134 commented Aug 1, 2024

@djhi I seem to not have the power to make a branch. Can you give me permissions?

@djhi
Copy link
Contributor

djhi commented Aug 1, 2024

You have to fork the repo, make your change on your fork and you should then have a button to submit a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants