False positive from unused variables validator when query variable is only used in object literal passed to @arguments
Open
shared with relay team
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
If I have a query like this:
```graphql
query TestQuery($foo: String!) {
...TestFragment @arguments(input: { foo: $foo })
}
```
I get an error like: "Variable `$foo` is never used in operation `TestQuery`"
However if I use that variable in another fragment without the object literal, I get no error and it compiles happily.
```graphql
query TestQuery($foo: String!) {
...TestFragment @arguments(input: { foo: $foo })
...TestTwoFragment @arguments(foo: $foo)
}
```
Is this a bug in the unused variables validator?
Contributor guide
Assessment
This issue has not been assessed yet.