eslint-plugin-graphql
eslint-plugin-graphql copied to clipboard
Unknown directive "connection"
trafficstars
Hi i'm using @connection directive but graphql/template-strings rule throws an error like the below
error Unknown directive "connection"
Query
const QUERY = gql`
query Community($offset: Int, $limit: Int!) {
posts(input: { offset: $offset, limit: $limit }) @connection(key: "CommunityPosts") {
id
content
title
createdAt
}
}
`
.eslintrc
{
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"flowtype",
"jsx-a11y",
"import",
"graphql"
],
"rules": {
...
"graphql/template-strings": ["error", { "env": "fraql" }]
},
...
}
How can I use with @connection directive ?
What I did for now, is that I added the directive to the generated schema. In the script that I have to generate the schema I append to the directives a custom one called connection with 2 arguments: key and filter.