Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql: Fix better error message when duplicate query name #1999

Closed
timbrandin opened this issue Sep 2, 2017 · 3 comments
Closed

Graphql: Fix better error message when duplicate query name #1999

timbrandin opened this issue Sep 2, 2017 · 3 comments

Comments

@timbrandin
Copy link

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.

@KyleAMathews
Copy link
Contributor

Hmm yeah that could be a lot better.

Could you create a PR with some improvements?

@jquense
Copy link
Contributor

jquense commented Sep 2, 2017

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

KyleAMathews added a commit that referenced this issue Sep 2, 2017
@KyleAMathews
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants