Display more graphql context when reporting parsing errors
Open
- Dominant language
- TypeScript
- Stars
- 20.3k
- Forks
- 2.1k
- Avg merge
- 44m
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.