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

[v2] Show GraphQL errors in browser and help debug e.g. by adding link to open bad query in graphiql #5234

Closed
KyleAMathews opened this issue May 2, 2018 · 8 comments
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.

Comments

@KyleAMathews
Copy link
Contributor

No description provided.

@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. 🏷 type: feature labels May 3, 2018
@leimonio
Copy link
Contributor

leimonio commented Jun 8, 2018

👋I was wondering if anyone is working on this, and if I can work on that.

@pieh
Copy link
Contributor

pieh commented Jun 8, 2018

@leimonio I don't think anyone is actively work on this one - feel free to own this one!

@leimonio
Copy link
Contributor

leimonio commented Jun 10, 2018

@pieh Just checked the codebase and noticed how the GraphQL errors are currently handled logged in the run instance. Is there any way you'd recommend passing errors to the console?
Maybe something like utils/test-require-error.js would work? Which would be the best place to import and use such utility?

@leimonio
Copy link
Contributor

Another idea would be to write errors in the .cache/json/{pageName}.json instead of the data and with a HOC console.log or even display a custom error on screen.

@pieh
Copy link
Contributor

pieh commented Jun 20, 2018

@leimonio Do you mean pass from node to browser? Maybe you could reuse websocket that we currently use to transport json data - so emit from query-runner.js and listen for those in cache-dir/root.js (and pass those errors to error overlay there)

@leimonio
Copy link
Contributor

leimonio commented Jul 1, 2018

#6247

pieh pushed a commit that referenced this issue Nov 9, 2018
This approach to displaying GraphQL compilation errors in the browser console utilizes the WebSocket connecting node running gatsby package responsible for executing GraphQL queries and the cache loaded and used on the browser side (thanks @pieh for helping in this). #5234
@LekoArts
Copy link
Contributor

LekoArts commented Dec 3, 2018

Done with #6247

@LekoArts LekoArts closed this as completed Dec 3, 2018
@gatsbot
Copy link

gatsbot bot commented Dec 12, 2018

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Dec 12, 2018
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this issue Jan 22, 2019
This approach to displaying GraphQL compilation errors in the browser console utilizes the WebSocket connecting node running gatsby package responsible for executing GraphQL queries and the cache loaded and used on the browser side (thanks @pieh for helping in this). gatsbyjs#5234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
Development

No branches or pull requests

5 participants