You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JS parser for graphql catches this error but is not currently caught by apollo_parser. The TypeCondition .named_type() gets resolved with None value.
This does look like a bug! If you’re interested in working on it, start by creating a crates/apollo-parser/test_data/parser/err/0053_on_without_type_condition.graphql file (assuming 0052 is still the last existing one when you do it) with the test input. I’ve simplified it a bit:
query {
...on {
field
}
}
fragmentF on {
field
}
Now run UPDATE_EXPECT=1 cargo test -p apollo-parser --lib parser_tests and check that the test fails with a "There should be errors" message.
Next modify the parser code in crates/apollo-parser/src/parser/grammar/fragment.rs (maybe adding some calls to p.err) until instead of that message the test creates a .txt file with two ERROR lines pointing at the inline fragment and at the fragment spread.
Once satisfied run the whole test suite with cargo test to make sure nothing else is broken, and cargo fmt && cargo clippy --all-targets to prepare a PR.
Description
please see: https://astexplorer.net/#/gist/e743877f4e424459a91a0f17670b787e/e52d925b8851a0190cdae33e6a3d88f6282dbb71
The JS parser for graphql catches this error but is not currently caught by apollo_parser. The TypeCondition
.named_type()
gets resolved with None value.P.S. for context in https://github.com/rishabh3112/graphql-tag-swc-plugin, I am updating parser from v0.2.10 to latest. earlier this was caught in parse, but now this is not being caught.
Steps to reproduce
run parser with following input:
For both no errors are there.
Expected result
Should be present in parse errors
Actual result
No errors
Environment
apollo-rs
crate:The text was updated successfully, but these errors were encountered: