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