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

fix displaying of graphql resolver errors #6142

Merged
merged 3 commits into from
Jun 26, 2018
Merged

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Jun 25, 2018

Currently if something in graphql resolver will throw error we will see somethink like this in console:

run graphql queriesError running queryRunner TypeError: Cannot read property 'componentPath' of undefined
    at module.exports (/Users/mike/dev/gatsby-v2/examples/using-contentful/node_modules/gatsby/dist/internal-plugins/query-runner/query-runner.js:47:36)

This fixes this and displays formatted error message

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jun 25, 2018

Deploy preview for using-drupal ready!

Built with commit 761ba68

https://deploy-preview-6142--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jun 25, 2018

Deploy preview for gatsbygram ready!

Built with commit 761ba68

https://deploy-preview-6142--gatsbygram.netlify.com

Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good!

Is it worth writing a couple of tests for formatErrorDetails? As a way of documenting expected inputs and outputs.

@pieh
Copy link
Contributor Author

pieh commented Jun 25, 2018

Is it worth writing a couple of tests for formatErrorDetails? As a way of documenting expected inputs and outputs.

Defenitely won't hurt :) I'll add those

Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@m-allanson m-allanson merged commit 7fd1898 into gatsbyjs:master Jun 26, 2018
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

Successfully merging this pull request may close these issues.

None yet

3 participants