Skip to content

Commit

Permalink
Add back graphql error fixes #1999 (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Sep 2, 2017
1 parent c9bf317 commit 6f7b8c3
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -175,12 +175,18 @@ export function graphqlError(
)
}

message = `There was an error while compiling your site's GraphQL queries. `
message = `There was an error while compiling your site's GraphQL queries.
${message}
`
if (error.message.match(/must be an instance of/)) {
message +=
`This usually means that more than one instance of 'graphql' is installed ` +
`in your node_modules. Remove all but the top level one or run \`npm dedupe\` to fix it.`
}

if (error.message.match(/Duplicate document/)) {
message += `${error.message.slice(21)}\n`
}

return message
}

0 comments on commit 6f7b8c3

Please sign in to comment.