Gatsby: Graphql: Fix better error message when duplicate query name

Created on 2 Sep 2017  Â·  3Comments  Â·  Source: gatsbyjs/gatsby

Right now when having multiple queries with the same name, the only output one gets in the console is:

GraphQL Error There was an error while compiling your site's GraphQL queries.

And nothing else, it's not even hinting on what the problem is.

Right now it's not very helpful, even when the error is as simple as having multiple queries with the same name.

Most helpful comment

Just ran into the same problem — fixed it in #2004

All 3 comments

Hmm yeah that could be a lot better.

Could you create a PR with some improvements?

I thought there was a better error for this already? Maybe it's getting shadows by something throwing earlier or maybe i just overlooked it. My guess is if you want to add something doing it here: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/internal-plugins/query-runner/graphql-errors.js#L162 is the best bet

Just ran into the same problem — fixed it in #2004

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  Â·  3Comments

brandonmp picture brandonmp  Â·  3Comments

kalinchernev picture kalinchernev  Â·  3Comments

3CordGuy picture 3CordGuy  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments