apollo-rs icon indicating copy to clipboard operation
apollo-rs copied to clipboard

Improve parser error formatting

Open goto-bus-stop opened this issue 2 years ago • 7 comments

ref https://github.com/apollographql/apollo-rs/pull/347#discussion_r1020325156

Right now parser errors show the index and the current token it's looking at, which isn't all that helpful to end users. IIRC Simon mentioned using the Python REPL to copy-paste the GraphQL source and slice it at the error index to get the context he needed.

ERROR@200:202 "Unterminated spread operator" ..

Maybe parser errors can use miette, like other parts of the project. We could even give suggestions in the future (like if we throw an "incomplete spread operator" error, we can suggest replacing it by a complete spread operator).

goto-bus-stop avatar Nov 16 '22 09:11 goto-bus-stop