Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query definition is not executable #272

Open
AdrienLemaire opened this issue May 29, 2020 · 3 comments
Open

Query definition is not executable #272

AdrienLemaire opened this issue May 29, 2020 · 3 comments

Comments

@AdrienLemaire
Copy link

AdrienLemaire commented May 29, 2020

Maybe related to #227

Do you know how to resolve this issue?

Using eslint-plugin-graphql 3.1.1 and Apollo client 3. The app seems to behave correctly with this implementation, so I expect no eslint error here.

.eslintrc.yml

---
env:
  browser: true
  es6: true
  jest: true
extends:
  - plugin:react-hooks/recommended
  - airbnb-typescript
  - airbnb/hooks
  - plugin:@typescript-eslint/eslint-recommended
  - plugin:@typescript-eslint/recommended
  - plugin:@typescript-eslint/recommended-requiring-type-checking
  # - plugin:jest/recommended
  - prettier  # disable rules that prettier auto-formats
  - prettier/react
  - prettier/@typescript-eslint
globals:
  Atomics: readonly
  SharedArrayBuffer: readonly
parser: '@typescript-eslint/parser'
parserOptions:
  ecmaFeatures:
    jsx: true
  ecmaVersion: 2018
  sourceType: module
  project: ./tsconfig.json
plugins:
  - react
  - '@typescript-eslint'
  - graphql
rules:
  # prop-types generated by babel-plugin-typescript-to-proptypes with webpack
  react/prop-types: 0
  graphql/template-strings:
    - error
    #- env: literal # determine from .graphqlconfig
    - env: apollo
      tagName: gql
      schemaJsonFilepath: ./schema.json
  "@typescript-eslint/no-use-before-define": 0
  # https://github.com/iamturns/eslint-config-airbnb-typescript/issues/98
  "@typescript-eslint/indent": ["error", 2, {}]
@AdrienLemaire
Copy link
Author

Ping on this issue @abernix @staylor @kamilkisiela (calling the most recent contributors).

@abernix
Copy link
Member

abernix commented Sep 4, 2020

I haven't used this plugin in years, but looking at your screenshot, I can't tell if you have any actual fields defined on that Query extension type or not.

@AmauryLiet
Copy link

AmauryLiet commented Nov 6, 2020

For everyone passing by and looking for a 5-sec hack: I renamed my schema from schema.graphql to schema.gql so that the linter does not look at it (config eslint --ext .ts,.tsx,.graphql with env: 'literal'). Don't forget to update your .eslintconfig with the new schema path ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants