Skip to content

Commit

Permalink
improve error message for graphql queries (#4615)
Browse files Browse the repository at this point in the history
* improve error message for graphql queries

Show where the `.cache` file is to make debugging easier.

* improve error message for graphql queries

Show the path (slug, usually) and the pluginID

* Update query-runner.js
  • Loading branch information
docwhat authored and KyleAMathews committed Apr 4, 2018
1 parent 98165f3 commit 9947fd3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ module.exports = async (pageOrLayout, component) => {
if (result && result.errors) {
report.log(
report.stripIndent`
The GraphQL query from ${component.componentPath} failed
The GraphQL query from ${component.componentPath} failed.
Errors:
${result.errors || []}
URL path:
${pageOrLayout.path}
Plugin:
${pageOrLayout.pluginCreatorId || `none`}
Query:
${component.query}
`
Expand Down

0 comments on commit 9947fd3

Please sign in to comment.