Closed timsuchanek closed 3 years ago
Hm, I thought this is not allowed syntax (so it's actually a parser which is broken). Is it?
Yes could also be the parser. So graphql-js allows it and we have real world application with that use-case, which already runs fine on graphql-js.
Where would you fix that? If you give me a hint in the code, I could also have a look.
Okay, looks like I'm wrong. So initially pointed line is the place to fix (probably by just moving closing brace). But please also add a test. Thanks!
Sounds good! PR is ready :)
Formatting this query:
returns this result:
Test code:
And I think the culprit is here: https://github.com/graphql-rust/graphql-parser/blob/master/src/query/format.rs#L156