@graphql-eslint/eslint-plugin 3.0.1 â 3.2.0-alpha-2e742a6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/README.md +57 -58
- package/docs/rules/known-fragment-names.md +9 -30
- package/docs/rules/no-undefined-variables.md +1 -1
- package/docs/rules/no-unreachable-types.md +0 -2
- package/docs/rules/no-unused-fields.md +0 -2
- package/docs/rules/no-unused-variables.md +1 -1
- package/index.js +185 -155
- package/index.mjs +187 -157
- package/package.json +1 -2
- package/rules/graphql-js-validation.d.ts +2 -5
package/docs/README.md
CHANGED
@@ -4,67 +4,66 @@ Each rule has emojis denoting:
|
|
4
4
|
|
5
5
|
- đ `graphql-eslint` rule
|
6
6
|
- đŽ `graphql-js` rule
|
7
|
-
- đ§ if some problems reported by the rule are automatically fixable by the `--fix` [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) option
|
8
7
|
|
9
8
|
<!-- đ¨ IMPORTANT! Do not manually modify this table. Run: `yarn generate:docs` -->
|
10
9
|
<!-- prettier-ignore-start -->
|
11
|
-
Name |Description| Config |đ / 
|
12
|
-
|
13
|
-
[alphabetize](rules/alphabetize.md)|Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more.|![all][]
|
14
|
-
[description-style](rules/description-style.md)|Require all comments to follow the same style (either block or inline).|![recommended][]
|
15
|
-
[executable-definitions](rules/executable-definitions.md)|A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions.|![recommended][]
|
16
|
-
[fields-on-correct-type](rules/fields-on-correct-type.md)|A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`.|![recommended][]
|
17
|
-
[fragments-on-composite-type](rules/fragments-on-composite-type.md)|Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type.|![recommended][]
|
18
|
-
[input-name](rules/input-name.md)|Require mutation argument to be always called "input" and input type to be called Mutation name + "Input".|![all][]
|
19
|
-
[known-argument-names](rules/known-argument-names.md)|A GraphQL field is only valid if all supplied arguments are defined by that field.|![recommended][]
|
20
|
-
[known-directives](rules/known-directives.md)|A GraphQL document is only valid if all `@directives` are known by the schema and legally positioned.|![recommended][]
|
21
|
-
[known-fragment-names](rules/known-fragment-names.md)|A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document.|![recommended][]
|
22
|
-
[known-type-names](rules/known-type-names.md)|A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema.|![recommended][]
|
23
|
-
[lone-anonymous-operation](rules/lone-anonymous-operation.md)|A GraphQL document is only valid if when it contains an anonymous operation (the query short-hand) that it contains only that one operation definition.|![recommended][]
|
24
|
-
[lone-schema-definition](rules/lone-schema-definition.md)|A GraphQL document is only valid if it contains only one schema definition.|![recommended][]
|
25
|
-
[match-document-filename](rules/match-document-filename.md)|This rule allows you to enforce that the file name should match the operation name.|![all][]
|
26
|
-
[naming-convention](rules/naming-convention.md)|Require names to follow specified conventions.|![recommended][]
|
27
|
-
[no-anonymous-operations](rules/no-anonymous-operations.md)|Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes.|![recommended][]
|
28
|
-
[no-case-insensitive-enum-values-duplicates](rules/no-case-insensitive-enum-values-duplicates.md)|Disallow case-insensitive enum values duplicates.|![recommended][]
|
29
|
-
[no-deprecated](rules/no-deprecated.md)|Enforce that deprecated fields or enum values are not in use by operations.|![recommended][]
|
30
|
-
[no-duplicate-fields](rules/no-duplicate-fields.md)|Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field.|![recommended][]
|
31
|
-
[no-fragment-cycles](rules/no-fragment-cycles.md)|A GraphQL fragment is only valid when it does not have cycles in fragments usage.|![recommended][]
|
32
|
-
[no-hashtag-description](rules/no-hashtag-description.md)|Requires to use `"""` or `"` for adding a GraphQL description instead of `#`.|![recommended][]
|
33
|
-
[no-root-type](rules/no-root-type.md)|Disallow using root types `mutation` and/or `subscription
|
34
|
-
[no-scalar-result-type-on-mutation](rules/no-scalar-result-type-on-mutation.md)|Avoid scalar result type on mutation type to make sure to return a valid state.|![all][]
|
35
|
-
[no-typename-prefix](rules/no-typename-prefix.md)|Enforces users to avoid using the type name in a field name while defining your schema.|![recommended][]
|
36
|
-
[no-undefined-variables](rules/no-undefined-variables.md)|A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation.|![recommended][]
|
37
|
-
[no-unreachable-types](rules/no-unreachable-types.md)|Requires all types to be reachable at some level by root level fields.|![recommended][]
|
38
|
-
[no-unused-fields](rules/no-unused-fields.md)|Requires all fields to be used at some level by siblings operations
|
39
|
-
[no-unused-fragments](rules/no-unused-fragments.md)|A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations.|![recommended][]
|
40
|
-
[no-unused-variables](rules/no-unused-variables.md)|A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment.|![recommended][]
|
41
|
-
[one-field-subscriptions](rules/one-field-subscriptions.md)|A GraphQL subscription is valid only if it contains a single root field.|![recommended][]
|
42
|
-
[overlapping-fields-can-be-merged](rules/overlapping-fields-can-be-merged.md)|A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity.|![recommended][]
|
43
|
-
[possible-fragment-spread](rules/possible-fragment-spread.md)|A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition.|![recommended][]
|
44
|
-
[possible-type-extension](rules/possible-type-extension.md)|A type extension is only valid if the type is defined and has the same kind
|
45
|
-
[provided-required-arguments](rules/provided-required-arguments.md)|A field or directive is only valid if all required (non-null without a default value) field arguments have been provided.|![recommended][]
|
46
|
-
[require-deprecation-date](rules/require-deprecation-date.md)|Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date.|![all][]
|
47
|
-
[require-deprecation-reason](rules/require-deprecation-reason.md)|Require all deprecation directives to specify a reason.|![recommended][]
|
48
|
-
[require-description](rules/require-description.md)|Enforce descriptions in your type definitions.|![recommended][]
|
49
|
-
[require-field-of-type-query-in-mutation-result](rules/require-field-of-type-query-in-mutation-result.md)|Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application.|![all][]
|
50
|
-
[require-id-when-available](rules/require-id-when-available.md)|Enforce selecting specific fields when they are available on the GraphQL type.|![recommended][]
|
51
|
-
[scalar-leafs](rules/scalar-leafs.md)|A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types.|![recommended][]
|
52
|
-
[selection-set-depth](rules/selection-set-depth.md)|Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://github.com/stems/graphql-depth-limit).|![recommended][]
|
53
|
-
[strict-id-in-types](rules/strict-id-in-types.md)|Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers.|![recommended][]
|
54
|
-
[unique-argument-names](rules/unique-argument-names.md)|A GraphQL field or directive is only valid if all supplied arguments are uniquely named.|![recommended][]
|
55
|
-
[unique-directive-names](rules/unique-directive-names.md)|A GraphQL document is only valid if all defined directives have unique names.|![recommended][]
|
56
|
-
[unique-directive-names-per-location](rules/unique-directive-names-per-location.md)|A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named.|![recommended][]
|
57
|
-
[unique-enum-value-names](rules/unique-enum-value-names.md)|A GraphQL enum type is only valid if all its values are uniquely named
|
58
|
-
[unique-field-definition-names](rules/unique-field-definition-names.md)|A GraphQL complex type is only valid if all its fields are uniquely named.|![recommended][]
|
59
|
-
[unique-fragment-name](rules/unique-fragment-name.md)|Enforce unique fragment names across your project.|![all][]
|
60
|
-
[unique-input-field-names](rules/unique-input-field-names.md)|A GraphQL input object value is only valid if all supplied fields are uniquely named.|![recommended][]
|
61
|
-
[unique-operation-name](rules/unique-operation-name.md)|Enforce unique operation names across your project.|![all][]
|
62
|
-
[unique-operation-types](rules/unique-operation-types.md)|A GraphQL document is only valid if it has only one type per operation.|![recommended][]
|
63
|
-
[unique-type-names](rules/unique-type-names.md)|A GraphQL document is only valid if all defined types have unique names.|![recommended][]
|
64
|
-
[unique-variable-names](rules/unique-variable-names.md)|A GraphQL operation is only valid if all its variables are uniquely named.|![recommended][]
|
65
|
-
[value-literals-of-correct-type](rules/value-literals-of-correct-type.md)|A GraphQL document is only valid if all value literals are of the type expected at their position.|![recommended][]
|
66
|
-
[variables-are-input-types](rules/variables-are-input-types.md)|A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).|![recommended][]
|
67
|
-
[variables-in-allowed-position](rules/variables-in-allowed-position.md)|Variables passed to field arguments conform to type.|![recommended][]
|
10
|
+
Name |Description| Config |đ / đŽ
|
11
|
+
-|-|:-:|:-:
|
12
|
+
[alphabetize](rules/alphabetize.md)|Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more.|![all][]|đ
|
13
|
+
[description-style](rules/description-style.md)|Require all comments to follow the same style (either block or inline).|![recommended][]|đ
|
14
|
+
[executable-definitions](rules/executable-definitions.md)|A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions.|![recommended][]|đŽ
|
15
|
+
[fields-on-correct-type](rules/fields-on-correct-type.md)|A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`.|![recommended][]|đŽ
|
16
|
+
[fragments-on-composite-type](rules/fragments-on-composite-type.md)|Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type.|![recommended][]|đŽ
|
17
|
+
[input-name](rules/input-name.md)|Require mutation argument to be always called "input" and input type to be called Mutation name + "Input".|![all][]|đ
|
18
|
+
[known-argument-names](rules/known-argument-names.md)|A GraphQL field is only valid if all supplied arguments are defined by that field.|![recommended][]|đŽ
|
19
|
+
[known-directives](rules/known-directives.md)|A GraphQL document is only valid if all `@directives` are known by the schema and legally positioned.|![recommended][]|đŽ
|
20
|
+
[known-fragment-names](rules/known-fragment-names.md)|A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document.|![recommended][]|đŽ
|
21
|
+
[known-type-names](rules/known-type-names.md)|A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema.|![recommended][]|đŽ
|
22
|
+
[lone-anonymous-operation](rules/lone-anonymous-operation.md)|A GraphQL document is only valid if when it contains an anonymous operation (the query short-hand) that it contains only that one operation definition.|![recommended][]|đŽ
|
23
|
+
[lone-schema-definition](rules/lone-schema-definition.md)|A GraphQL document is only valid if it contains only one schema definition.|![recommended][]|đŽ
|
24
|
+
[match-document-filename](rules/match-document-filename.md)|This rule allows you to enforce that the file name should match the operation name.|![all][]|đ
|
25
|
+
[naming-convention](rules/naming-convention.md)|Require names to follow specified conventions.|![recommended][]|đ
|
26
|
+
[no-anonymous-operations](rules/no-anonymous-operations.md)|Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes.|![recommended][]|đ
|
27
|
+
[no-case-insensitive-enum-values-duplicates](rules/no-case-insensitive-enum-values-duplicates.md)|Disallow case-insensitive enum values duplicates.|![recommended][]|đ
|
28
|
+
[no-deprecated](rules/no-deprecated.md)|Enforce that deprecated fields or enum values are not in use by operations.|![recommended][]|đ
|
29
|
+
[no-duplicate-fields](rules/no-duplicate-fields.md)|Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field.|![recommended][]|đ
|
30
|
+
[no-fragment-cycles](rules/no-fragment-cycles.md)|A GraphQL fragment is only valid when it does not have cycles in fragments usage.|![recommended][]|đŽ
|
31
|
+
[no-hashtag-description](rules/no-hashtag-description.md)|Requires to use `"""` or `"` for adding a GraphQL description instead of `#`.|![recommended][]|đ
|
32
|
+
[no-root-type](rules/no-root-type.md)|Disallow using root types `mutation` and/or `subscription`.||đ
|
33
|
+
[no-scalar-result-type-on-mutation](rules/no-scalar-result-type-on-mutation.md)|Avoid scalar result type on mutation type to make sure to return a valid state.|![all][]|đ
|
34
|
+
[no-typename-prefix](rules/no-typename-prefix.md)|Enforces users to avoid using the type name in a field name while defining your schema.|![recommended][]|đ
|
35
|
+
[no-undefined-variables](rules/no-undefined-variables.md)|A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation.|![recommended][]|đŽ
|
36
|
+
[no-unreachable-types](rules/no-unreachable-types.md)|Requires all types to be reachable at some level by root level fields.|![recommended][]|đ
|
37
|
+
[no-unused-fields](rules/no-unused-fields.md)|Requires all fields to be used at some level by siblings operations.||đ
|
38
|
+
[no-unused-fragments](rules/no-unused-fragments.md)|A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations.|![recommended][]|đŽ
|
39
|
+
[no-unused-variables](rules/no-unused-variables.md)|A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment.|![recommended][]|đŽ
|
40
|
+
[one-field-subscriptions](rules/one-field-subscriptions.md)|A GraphQL subscription is valid only if it contains a single root field.|![recommended][]|đŽ
|
41
|
+
[overlapping-fields-can-be-merged](rules/overlapping-fields-can-be-merged.md)|A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity.|![recommended][]|đŽ
|
42
|
+
[possible-fragment-spread](rules/possible-fragment-spread.md)|A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition.|![recommended][]|đŽ
|
43
|
+
[possible-type-extension](rules/possible-type-extension.md)|A type extension is only valid if the type is defined and has the same kind.||đŽ
|
44
|
+
[provided-required-arguments](rules/provided-required-arguments.md)|A field or directive is only valid if all required (non-null without a default value) field arguments have been provided.|![recommended][]|đŽ
|
45
|
+
[require-deprecation-date](rules/require-deprecation-date.md)|Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date.|![all][]|đ
|
46
|
+
[require-deprecation-reason](rules/require-deprecation-reason.md)|Require all deprecation directives to specify a reason.|![recommended][]|đ
|
47
|
+
[require-description](rules/require-description.md)|Enforce descriptions in your type definitions.|![recommended][]|đ
|
48
|
+
[require-field-of-type-query-in-mutation-result](rules/require-field-of-type-query-in-mutation-result.md)|Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application.|![all][]|đ
|
49
|
+
[require-id-when-available](rules/require-id-when-available.md)|Enforce selecting specific fields when they are available on the GraphQL type.|![recommended][]|đ
|
50
|
+
[scalar-leafs](rules/scalar-leafs.md)|A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types.|![recommended][]|đŽ
|
51
|
+
[selection-set-depth](rules/selection-set-depth.md)|Limit the complexity of the GraphQL operations solely by their depth. Based on [graphql-depth-limit](https://github.com/stems/graphql-depth-limit).|![recommended][]|đ
|
52
|
+
[strict-id-in-types](rules/strict-id-in-types.md)|Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers.|![recommended][]|đ
|
53
|
+
[unique-argument-names](rules/unique-argument-names.md)|A GraphQL field or directive is only valid if all supplied arguments are uniquely named.|![recommended][]|đŽ
|
54
|
+
[unique-directive-names](rules/unique-directive-names.md)|A GraphQL document is only valid if all defined directives have unique names.|![recommended][]|đŽ
|
55
|
+
[unique-directive-names-per-location](rules/unique-directive-names-per-location.md)|A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named.|![recommended][]|đŽ
|
56
|
+
[unique-enum-value-names](rules/unique-enum-value-names.md)|A GraphQL enum type is only valid if all its values are uniquely named.||đŽ
|
57
|
+
[unique-field-definition-names](rules/unique-field-definition-names.md)|A GraphQL complex type is only valid if all its fields are uniquely named.|![recommended][]|đŽ
|
58
|
+
[unique-fragment-name](rules/unique-fragment-name.md)|Enforce unique fragment names across your project.|![all][]|đ
|
59
|
+
[unique-input-field-names](rules/unique-input-field-names.md)|A GraphQL input object value is only valid if all supplied fields are uniquely named.|![recommended][]|đŽ
|
60
|
+
[unique-operation-name](rules/unique-operation-name.md)|Enforce unique operation names across your project.|![all][]|đ
|
61
|
+
[unique-operation-types](rules/unique-operation-types.md)|A GraphQL document is only valid if it has only one type per operation.|![recommended][]|đŽ
|
62
|
+
[unique-type-names](rules/unique-type-names.md)|A GraphQL document is only valid if all defined types have unique names.|![recommended][]|đŽ
|
63
|
+
[unique-variable-names](rules/unique-variable-names.md)|A GraphQL operation is only valid if all its variables are uniquely named.|![recommended][]|đŽ
|
64
|
+
[value-literals-of-correct-type](rules/value-literals-of-correct-type.md)|A GraphQL document is only valid if all value literals are of the type expected at their position.|![recommended][]|đŽ
|
65
|
+
[variables-are-input-types](rules/variables-are-input-types.md)|A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).|![recommended][]|đŽ
|
66
|
+
[variables-in-allowed-position](rules/variables-in-allowed-position.md)|Variables passed to field arguments conform to type.|![recommended][]|đŽ
|
68
67
|
<!-- prettier-ignore-end -->
|
69
68
|
[recommended]: https://img.shields.io/badge/-recommended-green.svg
|
70
69
|
[all]: https://img.shields.io/badge/-all-blue.svg
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- Category: `Operations`
|
6
6
|
- Rule name: `@graphql-eslint/known-fragment-names`
|
7
7
|
- Requires GraphQL Schema: `true` [âšī¸](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `
|
8
|
+
- Requires GraphQL Operations: `true` [âšī¸](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document.
|
11
11
|
|
@@ -13,7 +13,7 @@ A GraphQL document is only valid if all `...Fragment` fragment spreads refer to
|
|
13
13
|
|
14
14
|
## Usage Examples
|
15
15
|
|
16
|
-
### Incorrect
|
16
|
+
### Incorrect
|
17
17
|
|
18
18
|
```graphql
|
19
19
|
# eslint @graphql-eslint/known-fragment-names: 'error'
|
@@ -21,7 +21,7 @@ A GraphQL document is only valid if all `...Fragment` fragment spreads refer to
|
|
21
21
|
query {
|
22
22
|
user {
|
23
23
|
id
|
24
|
-
...UserFields
|
24
|
+
...UserFields # fragment not defined in the document
|
25
25
|
}
|
26
26
|
}
|
27
27
|
```
|
@@ -44,44 +44,23 @@ query {
|
|
44
44
|
}
|
45
45
|
```
|
46
46
|
|
47
|
-
### Correct (
|
47
|
+
### Correct (`UserFields` fragment located in a separate file)
|
48
48
|
|
49
49
|
```graphql
|
50
50
|
# eslint @graphql-eslint/known-fragment-names: 'error'
|
51
51
|
|
52
|
-
#
|
53
|
-
|
52
|
+
# user.gql
|
54
53
|
query {
|
55
54
|
user {
|
56
55
|
id
|
57
56
|
...UserFields
|
58
57
|
}
|
59
58
|
}
|
60
|
-
```
|
61
|
-
|
62
|
-
### False positive case
|
63
59
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
fragment UserFields on User {
|
69
|
-
id
|
70
|
-
}
|
71
|
-
`
|
72
|
-
|
73
|
-
const GET_USER = /* GraphQL */ `
|
74
|
-
# eslint @graphql-eslint/known-fragment-names: 'error'
|
75
|
-
|
76
|
-
query User {
|
77
|
-
user {
|
78
|
-
...UserFields
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
# Will give false positive error 'Unknown fragment "UserFields"'
|
83
|
-
${USER_FIELDS}
|
84
|
-
`
|
60
|
+
# user-fields.gql
|
61
|
+
fragment UserFields on User {
|
62
|
+
id
|
63
|
+
}
|
85
64
|
```
|
86
65
|
|
87
66
|
## Resources
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- Category: `Operations`
|
6
6
|
- Rule name: `@graphql-eslint/no-undefined-variables`
|
7
7
|
- Requires GraphQL Schema: `true` [âšī¸](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `
|
8
|
+
- Requires GraphQL Operations: `true` [âšī¸](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
9
|
|
10
10
|
A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation.
|
11
11
|
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
â
The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
-
đ§ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
|
6
|
-
|
7
5
|
- Category: `Schema`
|
8
6
|
- Rule name: `@graphql-eslint/no-unreachable-types`
|
9
7
|
- Requires GraphQL Schema: `true` [âšī¸](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -1,7 +1,5 @@
|
|
1
1
|
# `no-unused-fields`
|
2
2
|
|
3
|
-
đ§ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
|
4
|
-
|
5
3
|
- Category: `Schema`
|
6
4
|
- Rule name: `@graphql-eslint/no-unused-fields`
|
7
5
|
- Requires GraphQL Schema: `true` [âšī¸](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- Category: `Operations`
|
6
6
|
- Rule name: `@graphql-eslint/no-unused-variables`
|
7
7
|
- Requires GraphQL Schema: `true` [âšī¸](../../README.md#extended-linting-rules-with-graphql-schema)
|
8
|
-
- Requires GraphQL Operations: `
|
8
|
+
- Requires GraphQL Operations: `true` [âšī¸](../../README.md#extended-linting-rules-with-siblings-operations)
|
9
9
|
|
10
10
|
A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment.
|
11
11
|
|