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

Invalid configuration rule for "graphql/template-strings"

Open kryptonat opened this issue 5 years ago • 1 comments
trafficstars

Hi, I'm getting an unexpected validation rule error from giving an array of desired validators as per instructions. I had no issues with this configuration for [email protected] and [email protected] but don't see why it wouldn't work for the following package versions either.

module.exports = {
  parser: "babel-eslint",
  rules: {
    'graphql/template-strings': [
      'error',
      {
        env: 'apollo',
        validators: ['FieldsOnCorrectType'],
      },
    ],
  },
  plugins: ['graphql']
};

is giving the following error

Configuration for rule "graphql/template-strings" is invalid:
	Value "FieldsOnCorrectType" should be equal to one of the allowed values.
	Value ["FieldsOnCorrectType"] should be equal to one of the allowed values.
	Value ["FieldsOnCorrectType"] should match exactly one schema in oneOf.

Versions

[email protected] [email protected]

kryptonat avatar Aug 24 '20 22:08 kryptonat

Since you're using graphql 15, I believe that you have to add "Rule" suffix to your validators. So FieldsOnCorrectType should become FieldsOnCorrectTypeRule

Check this PR for more info : https://github.com/apollographql/eslint-plugin-graphql/pull/281

OlfaKaroui avatar Sep 17 '20 17:09 OlfaKaroui