graphql / graphql/graphql-js

Display more graphql context when reporting parsing errors

Open
#3,430 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.