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

Display more graphql context when reporting parsing errors #3430

Open
mschipperheyn opened this issue Dec 17, 2021 · 0 comments
Open

Display more graphql context when reporting parsing errors #3430

mschipperheyn opened this issue Dec 17, 2021 · 0 comments

Comments

@mschipperheyn
Copy link

mschipperheyn commented Dec 17, 2021

When a parsing error occurs, graphql reports cryptic errors that are often hard to locate

E.g. Syntax Error: Expected Name, found "!".

The problem is that, if you know where to look, it's often easy to fix. What ideally should happen is a display the part of the graphql that produces the parsing error, 2/3 lines before, 2/3 lines after.

An easy quick fix is to print the result of the lexer lookahead function. It gives some insight in where the issue occurs.

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

1 participant