November 26, 2024
@graphql-eslint/[email protected]
Major Changes
-
#2598
e771499
Thanks @bmulholland! - 1. graphql plugin can now we be specified
asplugins: { - '@graphql-eslint': { - graphqlPlugin.rules - } + '@graphql-eslint': graphqlPlugin }
-
Config rules should now be accessed through the
rules
propertyrules: { - ...graphqlESLint.configs['flat/operations-recommended'] + ...graphqlESLint.configs['flat/operations-recommended'].rules
-
processor can now be specified with accessing
processor
property- processor: graphql.processors.graphql + processor: graphqlPlugin.processor
-
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 backpossible-type-extension
rule toschema-recommended
config- add
unique-operation-name
andunique-fragment-name
rules tooperations-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 toschema-relay
To avoid confusing when users extend this config for executable definitions (operations and
fragments) - add
-
#1813
1c2d220
Thanks @dimaMachina! - -alphabetize
rule changes-
add
definitions: true
option forschema-all
/operations-all
configs -
rename
values: ['EnumTypeDefinition']
tovalues: true
-
rename
variables: ['OperationDefinition']
tovariables: true
-
add
groups: ['id', '*', 'createdAt', 'updatedAt']
forschema-all
/operations-all
configs -
require-id-when-available
rule changes- rename rule to
require-selections
- rename rule to
-
update
schema-all
/operations-all
configs -
require-description
rule changes- add
rootField: true
option forschema-recommended
config
- add
-
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'] } }
- add new options for
-
remove graphql-js'
unique-enum-value-names
rule -
rename
no-case-insensitive-enum-values-duplicates
tounique-enum-value-names
Since this rule reports case-insensitive enum values duplicates too
-
require-nullable-result-in-root
rule changesDo not check subscriptions
-
-
#1813
1c2d220
Thanks @dimaMachina! - - removeparserOptions.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
- remove
-
#2281
c53cb4e
Thanks @maciesielka! - Add new config option
ignoredFieldSelectors
tono-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! - - renamerequireSiblingsOperations
to
requireGraphQLOperations
- rename
requireGraphQLSchemaFromContext
torequireGraphQLSchema
- rename
-
#1813
1c2d220
Thanks @dimaMachina! - RemoveGraphQLRuleTester
from bundle,
to test your rules use regularRuleTester
from eslintNote: with this change unnecessary dependency
@babel/code-frame
was removed tooimport { RuleTester } from 'eslint' const ruleTester = new RuleTester({ parser: require.resolve('@graphql-eslint/eslint-plugin') })
-
#2319
b3c73dc
Thanks @maciesielka! - Enforcerequire-selections
on
FragmentSpread
s withinGraphQLUnionType
s
Minor Changes
-
#2385
afa8b8a
Thanks @deathemperor! - feat: add a new option{
for
alphabetize rule to sort fieldsselection 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 inno-deprecated
rule
Patch Changes
-
#1813
1c2d220
Thanks @dimaMachina! - dependencies updates:- Removed dependency
@babel/code-frame@^7.18.6
↗︎
(fromdependencies
)
- Removed dependency
-
#1813
1c2d220
Thanks @dimaMachina! - dependencies updates:- Updated dependency
graphql-config@^4.5.0
↗︎ (from
^4.4.0
, independencies
) - Removed dependency
@babel/code-frame@^7.18.6
↗︎
(fromdependencies
) - Removed dependency
chalk@^4.1.2
↗︎ (from
dependencies
) - Removed dependency
tslib@^2.4.1
↗︎ (from
dependencies
) - Updated dependency
graphql@^16
↗︎ (from
^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
,
inpeerDependencies
) - Added dependency
eslint@>=8.44.0
↗︎ (to
peerDependencies
)
- Updated dependency
-
#2455
08a8a13
Thanks @dimaMachina! - fix caching issues for
no-unreachable-types
/no-unused-fields
rules for multi projects -
#2483
d52585a
Thanks @dimaMachina! - fix compatibility with Node.js v22 -
#2743
03ccb9d
Thanks @dimaMachina! - fix error fromno-deprecated
rule
4.0.0-alpha.13: node.typeInfo(...).inputType.getFields is not a function
-
#2466
da608d7
Thanks @dimaMachina! - fixrequire is not defined
in flat
configs for Vue/Svelte projects -
#2277
3b35bae
Thanks @yoavain-sundaysky! - fix false positive cases for
require-import-fragment
on Windows, whengraphql-config
'sdocuments
key contained glob
pattern => source file path of document contained always forward slashes -
#2735
ccd9303
Thanks @dimaMachina! - fix reporting lint issues not on first
char of file for.vue
and support ESLint fixes and suggestions for them. Use
new official example -
#2468
733a66e
Thanks @dimaMachina! - - rename flat configs exports-graphql.flatConfigs['schema-recommended'] +graphql.configs['flat/schema-recommended'] -graphql.flatConfigs['schema-relay'] +graphql.configs['flat/schema-relay'] -graphql.flatConfigs['schema-all'] +graphql.configs['flat/schema-all'] -graphql.flatConfigs['operations-recommended'] +graphql.configs['flat/operations-recommended'] -graphql.flatConfigs['operations-all'] +graphql.configs['flat/operations-all']
- fix with programmatic usage when passing large schema as string causes
pattern too long
error - fix loading ESM
graphql.config.js
configs
- fix with programmatic usage when passing large schema as string causes
-
#2616
c0f1b07
Thanks @fcortes! - The import attribute syntax (with { type: "json"
}) is still experimental so warnings showed up when using the library as it was being used to
import the package.json file to extract the package versionAs an alternative, the current version will be injected on build time through tsup configuration.
-
#2605
2ae64e1
Thanks @dimaMachina! - fix types exports by
@arethetypeswrong/cli
package -
#2458
9096458
Thanks @dimaMachina! - addmeta
object withname
and
version
toparser
andprocessor
to be compatible with ESLint 9 -
#2692
dcf4e35
Thanks @dimaMachina! - fix some issues on Windows by running
tests with matrix on github CI -
#2711
b15df66
Thanks @dimaMachina! - Reenable running
require-id-when-available
onFragmentDefinition
-
#2752
1e3e966
Thanks @dimaMachina! - fix - Config types don't satisfy
FlatConfig.Config
-
#2721
cda7929
Thanks @dimaMachina! - fixno-unreachable-types
to consider
wrapped request directive argument types -
#2763
baba639
Thanks @dimaMachina! - fix
https://bit.ly/graphql-eslint-operations links -
#2713
8b6d46b
Thanks @dimaMachina! -naming-convention
rule should not fail
when aliasing underscore fields