@graphql-eslint/eslint-plugin 2.3.0-alpha-6ba4002.0 → 2.3.2-alpha-99be3d2.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/README.md +1 -1
- package/configs/all.d.ts +7 -0
- package/configs/index.d.ts +7 -0
- package/docs/README.md +2 -1
- package/docs/custom-rules.md +3 -3
- package/docs/rules/alphabetize.md +145 -0
- package/docs/rules/avoid-duplicate-fields.md +6 -1
- package/docs/rules/avoid-operation-name-prefix.md +8 -8
- package/docs/rules/avoid-scalar-result-type-on-mutation.md +6 -1
- package/docs/rules/avoid-typename-prefix.md +6 -1
- package/docs/rules/description-style.md +10 -9
- package/docs/rules/executable-definitions.md +6 -1
- package/docs/rules/fields-on-correct-type.md +6 -1
- package/docs/rules/fragments-on-composite-type.md +6 -1
- package/docs/rules/input-name.md +11 -10
- package/docs/rules/known-argument-names.md +6 -1
- package/docs/rules/known-directives.md +6 -1
- package/docs/rules/known-fragment-names.md +6 -1
- package/docs/rules/known-type-names.md +6 -1
- package/docs/rules/lone-anonymous-operation.md +6 -1
- package/docs/rules/lone-schema-definition.md +6 -1
- package/docs/rules/match-document-filename.md +12 -11
- package/docs/rules/naming-convention.md +21 -20
- package/docs/rules/no-anonymous-operations.md +6 -1
- package/docs/rules/no-case-insensitive-enum-values-duplicates.md +5 -1
- package/docs/rules/no-deprecated.md +6 -1
- package/docs/rules/no-fragment-cycles.md +6 -1
- package/docs/rules/no-hashtag-description.md +6 -1
- package/docs/rules/no-operation-name-suffix.md +5 -1
- package/docs/rules/no-undefined-variables.md +6 -1
- package/docs/rules/no-unreachable-types.md +6 -1
- package/docs/rules/no-unused-fields.md +6 -1
- package/docs/rules/no-unused-fragments.md +6 -1
- package/docs/rules/no-unused-variables.md +6 -1
- package/docs/rules/one-field-subscriptions.md +6 -1
- package/docs/rules/overlapping-fields-can-be-merged.md +6 -1
- package/docs/rules/possible-fragment-spread.md +6 -1
- package/docs/rules/possible-type-extension.md +6 -1
- package/docs/rules/provided-required-arguments.md +6 -1
- package/docs/rules/require-deprecation-date.md +5 -4
- package/docs/rules/require-deprecation-reason.md +6 -1
- package/docs/rules/require-description.md +5 -8
- package/docs/rules/require-field-of-type-query-in-mutation-result.md +6 -1
- package/docs/rules/require-id-when-available.md +6 -5
- package/docs/rules/scalar-leafs.md +6 -1
- package/docs/rules/selection-set-depth.md +6 -9
- package/docs/rules/strict-id-in-types.md +12 -11
- package/docs/rules/unique-argument-names.md +6 -1
- package/docs/rules/unique-directive-names-per-location.md +6 -1
- package/docs/rules/unique-directive-names.md +6 -1
- package/docs/rules/unique-enum-value-names.md +6 -1
- package/docs/rules/unique-field-definition-names.md +6 -1
- package/docs/rules/unique-fragment-name.md +6 -1
- package/docs/rules/unique-input-field-names.md +6 -1
- package/docs/rules/unique-operation-name.md +6 -1
- package/docs/rules/unique-operation-types.md +6 -1
- package/docs/rules/unique-type-names.md +6 -1
- package/docs/rules/unique-variable-names.md +6 -1
- package/docs/rules/value-literals-of-correct-type.md +6 -1
- package/docs/rules/variables-are-input-types.md +6 -1
- package/docs/rules/variables-in-allowed-position.md +6 -1
- package/estree-parser/estree-ast.d.ts +2 -2
- package/index.js +466 -102
- package/index.mjs +466 -102
- package/package.json +1 -1
- package/rules/alphabetize.d.ts +17 -0
- package/rules/index.d.ts +7 -0
- package/testkit.d.ts +6 -4
- package/types.d.ts +3 -0
- package/utils.d.ts +4 -0
@@ -33,97 +33,93 @@ type SomeTypeName {
|
|
33
33
|
|
34
34
|
## Config Schema
|
35
35
|
|
36
|
-
|
36
|
+
The schema defines the following properties:
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
The array object has the following properties:
|
41
|
-
|
42
|
-
#### `FieldDefinition`
|
38
|
+
### `FieldDefinition`
|
43
39
|
|
44
40
|
The object must be one of the following types:
|
45
41
|
|
46
42
|
* `asString`
|
47
43
|
* `asObject`
|
48
44
|
|
49
|
-
|
45
|
+
### `InputObjectTypeDefinition`
|
50
46
|
|
51
47
|
The object must be one of the following types:
|
52
48
|
|
53
49
|
* `asString`
|
54
50
|
* `asObject`
|
55
51
|
|
56
|
-
|
52
|
+
### `EnumValueDefinition`
|
57
53
|
|
58
54
|
The object must be one of the following types:
|
59
55
|
|
60
56
|
* `asString`
|
61
57
|
* `asObject`
|
62
58
|
|
63
|
-
|
59
|
+
### `InputValueDefinition`
|
64
60
|
|
65
61
|
The object must be one of the following types:
|
66
62
|
|
67
63
|
* `asString`
|
68
64
|
* `asObject`
|
69
65
|
|
70
|
-
|
66
|
+
### `ObjectTypeDefinition`
|
71
67
|
|
72
68
|
The object must be one of the following types:
|
73
69
|
|
74
70
|
* `asString`
|
75
71
|
* `asObject`
|
76
72
|
|
77
|
-
|
73
|
+
### `InterfaceTypeDefinition`
|
78
74
|
|
79
75
|
The object must be one of the following types:
|
80
76
|
|
81
77
|
* `asString`
|
82
78
|
* `asObject`
|
83
79
|
|
84
|
-
|
80
|
+
### `EnumTypeDefinition`
|
85
81
|
|
86
82
|
The object must be one of the following types:
|
87
83
|
|
88
84
|
* `asString`
|
89
85
|
* `asObject`
|
90
86
|
|
91
|
-
|
87
|
+
### `UnionTypeDefinition`
|
92
88
|
|
93
89
|
The object must be one of the following types:
|
94
90
|
|
95
91
|
* `asString`
|
96
92
|
* `asObject`
|
97
93
|
|
98
|
-
|
94
|
+
### `ScalarTypeDefinition`
|
99
95
|
|
100
96
|
The object must be one of the following types:
|
101
97
|
|
102
98
|
* `asString`
|
103
99
|
* `asObject`
|
104
100
|
|
105
|
-
|
101
|
+
### `OperationDefinition`
|
106
102
|
|
107
103
|
The object must be one of the following types:
|
108
104
|
|
109
105
|
* `asString`
|
110
106
|
* `asObject`
|
111
107
|
|
112
|
-
|
108
|
+
### `FragmentDefinition`
|
113
109
|
|
114
110
|
The object must be one of the following types:
|
115
111
|
|
116
112
|
* `asString`
|
117
113
|
* `asObject`
|
118
114
|
|
119
|
-
|
115
|
+
### `QueryDefinition`
|
120
116
|
|
121
117
|
The object must be one of the following types:
|
122
118
|
|
123
119
|
* `asString`
|
124
120
|
* `asObject`
|
125
121
|
|
126
|
-
|
122
|
+
### `leadingUnderscore` (string, enum)
|
127
123
|
|
128
124
|
This element must be one of the following enum values:
|
129
125
|
|
@@ -132,7 +128,7 @@ This element must be one of the following enum values:
|
|
132
128
|
|
133
129
|
Default: `"forbid"`
|
134
130
|
|
135
|
-
|
131
|
+
### `trailingUnderscore` (string, enum)
|
136
132
|
|
137
133
|
This element must be one of the following enum values:
|
138
134
|
|
@@ -182,4 +178,9 @@ The object is an array with all elements of the type `string`.
|
|
182
178
|
|
183
179
|
Additional restrictions:
|
184
180
|
|
185
|
-
* Minimum items: `1`
|
181
|
+
* Minimum items: `1`
|
182
|
+
|
183
|
+
## Resources
|
184
|
+
|
185
|
+
- [Rule source](../../packages/plugin/src/rules/naming-convention.ts)
|
186
|
+
- [Test source](../../packages/plugin/tests/naming-convention.spec.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL fragment is only valid when it does not have cycles in fragments usage.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoFragmentCyclesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoFragmentCyclesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoFragmentCyclesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/NoFragmentCyclesRule-test.ts)
|
@@ -47,4 +47,9 @@ type User {
|
|
47
47
|
id: ID! # This one is also valid, since it comes after the AST object
|
48
48
|
name: String
|
49
49
|
}
|
50
|
-
```
|
50
|
+
```
|
51
|
+
|
52
|
+
## Resources
|
53
|
+
|
54
|
+
- [Rule source](../../packages/plugin/src/rules/no-hashtag-description.ts)
|
55
|
+
- [Test source](../../packages/plugin/tests/no-hashtag-description.spec.ts)
|
@@ -9,4 +9,9 @@
|
|
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
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUndefinedVariablesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUndefinedVariablesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUndefinedVariablesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/NoUndefinedVariablesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedFragmentsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedFragmentsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedFragmentsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/NoUnusedFragmentsRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
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
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedVariablesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedVariablesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/NoUnusedVariablesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/NoUnusedVariablesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL subscription is valid only if it contains a single root field.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/SingleFieldSubscriptionsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/SingleFieldSubscriptionsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/SingleFieldSubscriptionsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
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.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
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.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleFragmentSpreadsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleFragmentSpreadsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleFragmentSpreadsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A type extension is only valid if the type is defined and has the same kind.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleTypeExtensionsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleTypeExtensionsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleTypeExtensionsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleTypeExtensionsRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A field or directive is only valid if all required (non-null without a default value) field arguments have been provided.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ProvidedRequiredArgumentsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ProvidedRequiredArgumentsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ProvidedRequiredArgumentsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts)
|
@@ -44,10 +44,11 @@ type User {
|
|
44
44
|
|
45
45
|
## Config Schema
|
46
46
|
|
47
|
-
|
47
|
+
The schema defines the following properties:
|
48
48
|
|
49
|
-
|
49
|
+
### `argumentName` (string)
|
50
50
|
|
51
|
-
|
51
|
+
## Resources
|
52
52
|
|
53
|
-
|
53
|
+
- [Rule source](../../packages/plugin/src/rules/require-deprecation-date.ts)
|
54
|
+
- [Test source](../../packages/plugin/tests/require-deprecation-date.spec.ts)
|
@@ -39,4 +39,9 @@ type MyType {
|
|
39
39
|
type MyType {
|
40
40
|
name: String @deprecated(reason: "no longer relevant, please use fullName field")
|
41
41
|
}
|
42
|
-
```
|
42
|
+
```
|
43
|
+
|
44
|
+
## Resources
|
45
|
+
|
46
|
+
- [Rule source](../../packages/plugin/src/rules/require-deprecation-reason.ts)
|
47
|
+
- [Test source](../../packages/plugin/tests/require-deprecation-reason.spec.ts)
|
@@ -37,13 +37,9 @@ type someTypeName {
|
|
37
37
|
|
38
38
|
## Config Schema
|
39
39
|
|
40
|
-
|
40
|
+
The schema defines the following properties:
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
The array object has the following properties:
|
45
|
-
|
46
|
-
#### `on` (array)
|
42
|
+
### `on` (array)
|
47
43
|
|
48
44
|
The object is an array with all elements of the type `string`.
|
49
45
|
|
@@ -51,6 +47,7 @@ Additional restrictions:
|
|
51
47
|
|
52
48
|
* Minimum items: `1`
|
53
49
|
|
54
|
-
|
50
|
+
## Resources
|
55
51
|
|
56
|
-
|
52
|
+
- [Rule source](../../packages/plugin/src/rules/require-description.ts)
|
53
|
+
- [Test source](../../packages/plugin/tests/require-description.spec.ts)
|
@@ -39,4 +39,9 @@ type CreateUserPayload {
|
|
39
39
|
type Mutation {
|
40
40
|
createUser: CreateUserPayload!
|
41
41
|
}
|
42
|
-
```
|
42
|
+
```
|
43
|
+
|
44
|
+
## Resources
|
45
|
+
|
46
|
+
- [Rule source](../../packages/plugin/src/rules/require-field-of-type-query-in-mutation-result.ts)
|
47
|
+
- [Test source](../../packages/plugin/tests/require-field-of-type-query-in-mutation-result.spec.ts)
|
@@ -50,12 +50,13 @@ query user {
|
|
50
50
|
|
51
51
|
## Config Schema
|
52
52
|
|
53
|
-
|
53
|
+
The schema defines the following properties:
|
54
54
|
|
55
|
-
|
55
|
+
### `fieldName` (string)
|
56
56
|
|
57
|
-
|
57
|
+
Default: `"id"`
|
58
58
|
|
59
|
-
|
59
|
+
## Resources
|
60
60
|
|
61
|
-
|
61
|
+
- [Rule source](../../packages/plugin/src/rules/require-id-when-available.ts)
|
62
|
+
- [Test source](../../packages/plugin/tests/require-id-when-available.spec.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ScalarLeafsRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ScalarLeafsRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ScalarLeafsRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ScalarLeafsRule-test.ts)
|
@@ -53,18 +53,15 @@ query deep2 {
|
|
53
53
|
|
54
54
|
## Config Schema
|
55
55
|
|
56
|
-
|
56
|
+
The schema defines the following properties:
|
57
57
|
|
58
|
-
|
58
|
+
### `maxDepth` (number)
|
59
59
|
|
60
|
-
|
61
|
-
|
62
|
-
#### `maxDepth` (number)
|
63
|
-
|
64
|
-
#### `ignore` (array)
|
60
|
+
### `ignore` (array)
|
65
61
|
|
66
62
|
The object is an array with all elements of the type `string`.
|
67
63
|
|
68
|
-
|
64
|
+
## Resources
|
69
65
|
|
70
|
-
|
66
|
+
- [Rule source](../../packages/plugin/src/rules/selection-set-depth.ts)
|
67
|
+
- [Test source](../../packages/plugin/tests/selection-set-depth.spec.ts)
|
@@ -62,13 +62,9 @@ type Error {
|
|
62
62
|
|
63
63
|
## Config Schema
|
64
64
|
|
65
|
-
|
65
|
+
The schema defines the following properties:
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
The array object has the following properties:
|
70
|
-
|
71
|
-
#### `acceptedIdNames` (array)
|
67
|
+
### `acceptedIdNames` (array)
|
72
68
|
|
73
69
|
The object is an array with all elements of the type `string`.
|
74
70
|
|
@@ -80,7 +76,7 @@ Default:
|
|
80
76
|
]
|
81
77
|
```
|
82
78
|
|
83
|
-
|
79
|
+
### `acceptedIdTypes` (array)
|
84
80
|
|
85
81
|
The object is an array with all elements of the type `string`.
|
86
82
|
|
@@ -92,11 +88,11 @@ Default:
|
|
92
88
|
]
|
93
89
|
```
|
94
90
|
|
95
|
-
|
91
|
+
### `exceptions` (object)
|
96
92
|
|
97
93
|
Properties of the `exceptions` object:
|
98
94
|
|
99
|
-
|
95
|
+
#### `types` (array)
|
100
96
|
|
101
97
|
This is used to exclude types with names that match one of the specified values.
|
102
98
|
|
@@ -108,7 +104,7 @@ Default:
|
|
108
104
|
[]
|
109
105
|
```
|
110
106
|
|
111
|
-
|
107
|
+
#### `suffixes` (array)
|
112
108
|
|
113
109
|
This is used to exclude types with names with suffixes that match one of the specified values.
|
114
110
|
|
@@ -118,4 +114,9 @@ Default:
|
|
118
114
|
|
119
115
|
```
|
120
116
|
[]
|
121
|
-
```
|
117
|
+
```
|
118
|
+
|
119
|
+
## Resources
|
120
|
+
|
121
|
+
- [Rule source](../../packages/plugin/src/rules/strict-id-in-types.ts)
|
122
|
+
- [Test source](../../packages/plugin/tests/strict-id-in-types.spec.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL field or directive is only valid if all supplied arguments are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueArgumentNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueArgumentNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueArgumentNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueArgumentNamesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectivesPerLocationRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectivesPerLocationRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectivesPerLocationRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all defined directives have unique names.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectiveNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectiveNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectiveNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueDirectiveNamesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL enum type is only valid if all its values are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueEnumValueNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueEnumValueNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueEnumValueNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueEnumValueNamesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL complex type is only valid if all its fields are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueFieldDefinitionNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueFieldDefinitionNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueFieldDefinitionNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueFieldDefinitionNamesRule-test.ts)
|
@@ -43,4 +43,9 @@ fragment AllUserFields on User {
|
|
43
43
|
fragment UserFields on User {
|
44
44
|
id
|
45
45
|
}
|
46
|
-
```
|
46
|
+
```
|
47
|
+
|
48
|
+
## Resources
|
49
|
+
|
50
|
+
- [Rule source](../../packages/plugin/src/rules/unique-fragment-name.ts)
|
51
|
+
- [Test source](../../packages/plugin/tests/unique-fragment-name.spec.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL input object value is only valid if all supplied fields are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueInputFieldNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueInputFieldNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueInputFieldNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if it has only one type per operation.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueOperationTypesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueOperationTypesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueOperationTypesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueOperationTypesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all defined types have unique names.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueTypeNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueTypeNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueTypeNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueTypeNamesRule-test.ts)
|
@@ -9,4 +9,9 @@
|
|
9
9
|
|
10
10
|
A GraphQL operation is only valid if all its variables are uniquely named.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueVariableNamesRule.ts).
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueVariableNamesRule.ts).
|
13
|
+
|
14
|
+
## Resources
|
15
|
+
|
16
|
+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueVariableNamesRule.ts)
|
17
|
+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueVariableNamesRule-test.ts)
|