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

Error recovery in the parser #451

Open
goto-bus-stop opened this issue Feb 8, 2023 · 0 comments
Open

Error recovery in the parser #451

goto-bus-stop opened this issue Feb 8, 2023 · 0 comments
Labels
apollo-parser bug Something isn't working

Comments

@goto-bus-stop
Copy link
Member

The parser does its best with any invalid input it gets. We have a few cases where it could be better.

type A {
  field1: Int
  |||garbage|||
  field2: Int
}

A parse error on line 3 here causes the parser to "unwind" all the way back to the root node before continuing to parse. Here the ideal way to do it would be to eat the garbage and continue parsing the fields definition.

(add more examples as necessary?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-parser bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant