Skip to content

November 26, 2024

Compare
Choose a tag to compare
@github-actions github-actions released this 26 Nov 13:42
· 68 commits to master since this release
28e6853

@graphql-eslint/[email protected]

Major Changes

  • #2598
    e771499
    Thanks @bmulholland! - 1. graphql plugin can now we be specified
    as

    plugins: {
    -  '@graphql-eslint': {
    -    graphqlPlugin.rules
    -  }
    +  '@graphql-eslint': graphqlPlugin
    }
    1. Config rules should now be accessed through the rules property

        rules: {
      -   ...graphqlESLint.configs['flat/operations-recommended']
      +   ...graphqlESLint.configs['flat/operations-recommended'].rules
    2. processor can now be specified with accessing processor property

      - processor: graphql.processors.graphql
      + processor: graphqlPlugin.processor
    3. The plugin can now be imported using a default import

      - import * as graphql from '@graphql-eslint/eslint-plugin'
      + import graphqlPlugin from '@graphql-eslint/eslint-plugin'
  • #1813
    1c2d220
    Thanks @dimaMachina! - - bring back possible-type-extension
    rule to schema-recommended config

    • add unique-operation-name and unique-fragment-name rules to operations-recommended config

    The concept of sibling operations provided by graphql-config's documents fields is based on
    uniquely named operations and fragments, for omitting false-positive/negative cases when
    operations and fragments are located in separate files. For this reason, these rules must be
    included in the recommended config

    • rename relay config to schema-relay

    To avoid confusing when users extend this config for executable definitions (operations and
    fragments)

  • #1813
    1c2d220
    Thanks @dimaMachina! - - alphabetize rule changes

    • add definitions: true option for schema-all/operations-all configs

    • rename values: ['EnumTypeDefinition'] to values: true

    • rename variables: ['OperationDefinition'] to variables: true

    • add groups: ['id', '*', 'createdAt', 'updatedAt'] for schema-all/operations-all configs

    • require-id-when-available rule changes

      • rename rule to require-selections
    • update schema-all/operations-all configs

    • require-description rule changes

      • add rootField: true option for schema-recommended config
    • require eslint at least >=8.44.0 as peerDependency

    • naming-convention

      • add new options for schema-recommended config
      {
        'EnumTypeDefinition,EnumTypeExtension': {
          forbiddenPrefixes: ['Enum'],
          forbiddenSuffixes: ['Enum']
        },
        'InterfaceTypeDefinition,InterfaceTypeExtension': {
          forbiddenPrefixes: ['Interface'],
          forbiddenSuffixes: ['Interface']
        },
        'UnionTypeDefinition,UnionTypeExtension': {
          forbiddenPrefixes: ['Union'],
          forbiddenSuffixes: ['Union']
        },
        'ObjectTypeDefinition,ObjectTypeExtension': {
          forbiddenPrefixes: ['Type'],
          forbiddenSuffixes: ['Type']
        }
      }
    • remove graphql-js' unique-enum-value-names rule

    • rename no-case-insensitive-enum-values-duplicates to unique-enum-value-names

      Since this rule reports case-insensitive enum values duplicates too

    • require-nullable-result-in-root rule changes

      Do not check subscriptions

  • #1813
    1c2d220
    Thanks @dimaMachina! - - remove parserOptions.schema

    • remove parserOptions.documents
    • remove parserOptions.extensions
    • remove parserOptions.include
    • remove parserOptions.exclude
    • remove parserOptions.projects
    • remove parserOptions.schemaOptions
    • remove parserOptions.graphQLParserOptions
    • remove parserOptions.skipGraphQLConfig
    • remove parserOptions.operations
    • add parserOptions.graphQLConfig?: IGraphQLConfig for programmatic usage
  • #2281
    c53cb4e
    Thanks @maciesielka! - Add new config option
    ignoredFieldSelectors to no-unused-fields rule to ignore all the relay pagination fields for
    every connection exposed in schema for example

  • #1813
    1c2d220
    Thanks @dimaMachina! - drop support of Node.js 12/14/16, GraphQL
    14/15

  • #2418
    c2d5386
    Thanks @comatory! - exposing GraphQLESTreeNode type

  • #2768
    241936a
    Thanks @dimaMachina! - - rename requireSiblingsOperations to
    requireGraphQLOperations

    • rename requireGraphQLSchemaFromContext to requireGraphQLSchema
  • #1813
    1c2d220
    Thanks @dimaMachina! - Remove GraphQLRuleTester from bundle,
    to test your rules use regular RuleTester from eslint

    Note: with this change unnecessary dependency @babel/code-frame was removed too

    import { RuleTester } from 'eslint'
    
    const ruleTester = new RuleTester({
      parser: require.resolve('@graphql-eslint/eslint-plugin')
    })
  • #2319
    b3c73dc
    Thanks @maciesielka! - Enforce require-selections on
    FragmentSpreads within GraphQLUnionTypes

Minor Changes

  • #2385
    afa8b8a
    Thanks @deathemperor! - feat: add a new option { for
    alphabetize rule to sort fields selection set

  • #2293
    01f7087
    Thanks @yoavsion! - Support the fragment spread group when defining
    alphabetize rule's groups with new option ...

  • #2719
    57d6edf
    Thanks @dimaMachina! - check for deprecated arguments and object
    field nodes in graphql operations in no-deprecated rule

Patch Changes