Skip to content

Commit

Permalink
Error 85927
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Jan 21, 2020
1 parent 5655304 commit 2bcf5a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gatsby-cli/src/structured-errors/error-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ export const errorMap = {
type: Type.GRAPHQL,
level: Level.ERROR,
},
"85927": {
text: (context): string =>
`There was an error in your GraphQL query:\n\n${context.sourceMessage}\n\nSee if ${context.variable} has a typo or ${context.operation} doesn't actually require this variable.`,
type: Type.GRAPHQL,
level: Level.ERROR,
},
// Config errors
"10123": {
text: (context): string =>
Expand Down
13 changes: 13 additions & 0 deletions packages/gatsby/src/query/error-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ const errorParser = ({
}
},
},
{
regex: /Variable "(.+)" is never used in operation "(.+)".*/ms,
cb: match => {
return {
id: `85927`,
context: {
sourceMessage: match[0],
variable: match[1],
operation: match[2],
},
}
},
},
// Match anything with a generic catch-all error handler
{
regex: /[\s\S]*/gm,
Expand Down

0 comments on commit 2bcf5a8

Please sign in to comment.