eslint-plugin-graphql icon indicating copy to clipboard operation
eslint-plugin-graphql copied to clipboard

Unknown directive "connection"

Open jeongsd opened this issue 6 years ago • 1 comments
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 ?

jeongsd avatar Nov 28 '18 02:11 jeongsd

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.

Erid avatar Apr 22 '19 16:04 Erid