Skip to content

Releases: dimaMachina/graphql-eslint

@graphql-eslint/[email protected]

20 Jan 10:11
13e427f
Compare
Choose a tag to compare

Minor Changes

  • 6f8c3b6: fix: find graphqlrc files relative to linted file

@graphql-eslint/[email protected]

03 Jan 12:33
c7299bd
Compare
Choose a tag to compare

Minor Changes

  • 624d604: fix: ignore root types in strict-id-in-types rule

@graphql-eslint/[email protected]

02 Jan 08:56
9095140
Compare
Choose a tag to compare

Minor Changes

  • cc9a561: feat: ignore fragments in require-id-when-available rule

@graphql-eslint/[email protected]

02 Jan 08:53
530a459
Compare
Choose a tag to compare

Minor Changes

  • 75ec7d1: fix false positive case in possible-type-extension rule when schema is separate into multiple files

@graphql-eslint/[email protected]

27 Dec 13:02
18c3cf1
Compare
Choose a tag to compare

Minor Changes

  • b4c5d55: feat: add new option ignorePattern for naming-convention rule
  • f20f7de: feat: remove the need of #import comments in favor of parserOptions.operations

@graphql-eslint/[email protected]

14 Dec 18:23
3622fea
Compare
Choose a tag to compare

Minor Changes

  • 2c73cb7: feat: add suggestions for naming-convention rule
  • 11b3af6: feat: support multiple id field names in require-id-when-available rule

Patch Changes

  • 503dd9f: fix error report location for graphql-js rules
  • 9378d24: Fix exports in package.json for react-native projects

@graphql-eslint/[email protected]

08 Dec 12:45
75e41ed
Compare
Choose a tag to compare

Minor Changes

  • 37c1579: feat: convert fix to suggestions in no-unreachable-types and no-unused-fields rules

Patch Changes

  • 988e445: fix: ignore operations and fragments in no-hashtag-description rule

@graphql-eslint/[email protected]

28 Nov 07:43
6a1b6cc
Compare
Choose a tag to compare

Patch Changes

  • 32ec2cb: fix: ignore arguments in require-field-of-type-query-in-mutation-result rule
  • 5a259ce: chore: remove unique-enum-value-names rule from recommended config
  • 36d5334: fix: ignore arguments in no-scalar-result-type-on-mutation rule

@graphql-eslint/[email protected]

21 Nov 11:45
7c5e23f
Compare
Choose a tag to compare

Major Changes

  • a69f0be: ❗ BREAKING CHANGE ❗

    Split recommended config to 2 modes: "schema" and "operations".

    This was done in order to use recommended and all configs in schema-only projects where it is not possible to provide operations.

    recommended and all configs were divided to 4 configs:

    • schema-recommended - enables recommended rules for schema (SDL) development
    • schema-all - enables all rules for schema (SDL) development
    • operations-recommended - enables recommended rules for consuming GraphQL (operations) development
    • operations-all - enables all rules for consuming GraphQL (operations) development

    If you are migrating from v2 where recommended was introduced, please change the following:

    {
      "overrides": [
        {
          "files": ["*.js"],
          "processor": "@graphql-eslint/graphql"
        },
        {
          "files": ["*.graphql"],
    -     "extends": "plugin:@graphql-eslint/recommended"
    +     "extends": "plugin:@graphql-eslint/schema-recommended"
        }
      ]
    }

    If you are in a project that develops the GraphQL schema, you'll need schema rules.

    If you are in a project that develops GraphQL operations (query/mutation/subscription), you'll need operations rules.

    If you are in a monorepo project, you probably need both sets of rules.

  • a69f0be: ❗ BREAKING CHANGE ❗

    feat: description-style now have default description style block.

  • a69f0be: ❗ BREAKING CHANGE ❗

    feat: remove query option in no-root-type as it's impossible to have write-only schema.

  • a69f0be: ❗ BREAKING CHANGE ❗

    • rename avoid prefix in rules to no.
    • remove avoid-operation-name-prefix and no-operation-name-suffix

    All rules that had a avoid prefix now have a no prefix.

    Rules avoid-operation-name-prefix and no-operation-name-suffix were removed because the same things can be validated by naming-convention rule.

    Before

    {
      "@graphql-eslint/avoid-operation-name-prefix": [
        "error",
        {
          "keywords": ["Query", "Mutation", "Subscription", "Get"]
        }
      ],
      "@graphql-eslint/no-operation-name-suffix": "error"
    }

    After

    {
      "@graphql-eslint/naming-convention": [
        "error",
        {
          "OperationDefinition": {
            "style": "PascalCase",
            "forbiddenPrefixes": ["Query", "Mutation", "Subscription", "Get"],
            "forbiddenSuffixes": ["Query", "Mutation", "Subscription"]
          }
        }
      ]
    }
  • a69f0be: ❗ BREAKING CHANGE ❗

    feat: add new options for naming-convention rule

    Options for naming-convention are changed. New option types includes the following kinds:

    • ObjectTypeDefinition
    • InterfaceTypeDefinition
    • EnumTypeDefinition
    • ScalarTypeDefinition
    • InputObjectTypeDefinition
    • UnionTypeDefinition

    Added new options:

    • Argument
    • DirectiveDefinition
    • VariableDefinition

    Option QueryDefinition was removed in favor of AST specific selector FieldDefinition[parent.name.value=Query].

    Before

    {
      "@graphql-eslint/naming-convention": [
        "error",
        {
          "ObjectTypeDefinition": "PascalCase",
          "InterfaceTypeDefinition": "PascalCase",
          "EnumTypeDefinition": "PascalCase",
          "ScalarTypeDefinition": "PascalCase",
          "InputObjectTypeDefinition": "PascalCase",
          "UnionTypeDefinition": "PascalCase",
          "FieldDefinition": "camelCase",
          "InputValueDefinition": "camelCase",
          "QueryDefinition": {
            "forbiddenPrefixes": ["get"]
          },
          "leadingUnderscore": "allow",
          "trailingUnderscore": "allow"
        }
      ]
    }

    After

    {
      "@graphql-eslint/naming-convention": [
        "error",
        {
          "types": "PascalCase",
          "FieldDefinition": "camelCase",
          "InputValueDefinition": "camelCase",
          "FieldDefinition[parent.name.value=Query]": {
            "forbiddenPrefixes": ["get"]
          },
          "allowLeadingUnderscore": true,
          "allowTrailingUnderscore": true
        }
      ]
    }
  • a69f0be: ❗ BREAKING CHANGE ❗

    feat: add new options for require-description rule

    Options for require-description are changed. New option types includes the following kinds:

    • ObjectTypeDefinition
    • InterfaceTypeDefinition
    • EnumTypeDefinition
    • ScalarTypeDefinition (new in v3)
    • InputObjectTypeDefinition
    • UnionTypeDefinition

    Before

    {
      "@graphql-eslint/require-description": [
        "error",
        {
          "on": [
            "ObjectTypeDefinition",
            "InterfaceTypeDefinition",
            "EnumTypeDefinition",
            "InputObjectTypeDefinition",
            "UnionTypeDefinition",
            "FieldDefinition",
            "InputValueDefinition",
            "EnumValueDefinition",
            "DirectiveDefinition"
          ]
        }
      ]
    }

    After

    {
      "@graphql-eslint/require-description": [
        "error",
        {
          "types": true,
          "FieldDefinition": true,
          "InputValueDefinition": true,
          "EnumValueDefinition": true,
          "DirectiveDefinition": true
        }
      ]
    }

@graphql-eslint/[email protected]

13 Nov 07:11
40401a0
Compare
Choose a tag to compare

Minor Changes

  • 64c302c: feat: add new rule no-root-type
  • c837c99: fix false positive case in no-unreachable-types rule when directive on root schema is used
  • 1914d6a: fix false positive case in known-fragment-names when import nested fragment

Patch Changes

  • 4c29de7: fix: make works graphql-eslint in yarn berry