dimaMachina / graphql-eslint

ESLint parser, plugin and set rules for GraphQL (for schema and operations). Easily customizable with custom rules. Integrates with IDEs and modern GraphQL tools.
https://the-guild.dev/graphql/eslint
MIT License
795 stars 103 forks source link

Cannot read properties of undefined (reading 'parserServices') #1981

Closed waynezhang1995 closed 2 weeks ago

waynezhang1995 commented 11 months ago

Issue workflow progress

Progress of the issue based on the Contributor Workflow


Describe the bug

We upgraded to "@graphql-eslint/eslint-plugin": "4.0.0-alpha.0", recently and this error started coming out.

We have the following setup in the eslintrc.js file

{
      files: '*.graphql',
      parser: "@graphql-eslint/eslint-plugin",
      parserOptions: {
        filePath: './graphql.config.js',
      },
    }

Based on the example, parserOptions seems unnecessary here and we do have a graphql.config.js file that colocates to the eslintrc file with the following content:

module.exports = {
  schema: ['./schema.graphql'],
  documents: ['./src/**/*.{ts,tsx}'],
};

Any ideas please?

To Reproduce Steps to reproduce the behavior:

Expected behavior

Environment:

Additional context

dimaMachina commented 11 months ago

where did you find that you need to specify parserOptions.filePath for your graphql-config?

waynezhang1995 commented 11 months ago

where did you find that you need to specify parserOptions.filePath for your graphql-config?

it was set up like that before, and it worked in the previous version. Going to try removing it and see if things start working