eslint-plugin-graphql
eslint-plugin-graphql copied to clipboard
Variable define a query and use inside a fragment
trafficstars
Hi,
I have this lint error :

Here my Query :
#import './user-fragment.gql'
query GetUser($id: Int!, $filter: String, $sorts: [String!]) {
user(id: $id) {
...UserFragment
}
}
And here my Fragment :
fragment UserFragment on User {
id
username
name
email
time_zone
state
custom_expression_access
user_roles(filter: $filter, sorts: $sorts) {
id
role {
id
name
type
}
}
}
The linter seems not recognized that $filter is use by the Fragment and send me a error. Do we have a solution for this kind of issue or I have to add a // eslint-disable-next-line in the Query file ?