@graphql-eslint/eslint-plugin 3.0.0-alpha-698204a.0 → 3.0.0-alpha-0a996de.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 CHANGED
@@ -180,6 +180,10 @@ You can find a list of [ESLint directives here](https://eslint.org/docs/2.13.1/u
180
180
 
181
181
  You can find a complete list of [all available rules here](docs/README.md).
182
182
 
183
+ ## Deprecated Rules
184
+
185
+ See [docs/deprecated-rules.md](docs/deprecated-rules.md).
186
+
183
187
  ## Available Configs
184
188
 
185
189
  <!-- prettier-ignore-start -->
@@ -187,7 +191,7 @@ You can find a complete list of [all available rules here](docs/README.md).
187
191
  |:-:|-|
188
192
  |[`schema-recommended`](packages/plugin/src/configs/schema-recommended.ts)|enables all recommended rules|
189
193
  |[`operations-recommended`](packages/plugin/src/configs/operations-recommended.ts) |enables all recommended rules|
190
- |[`schema-all`](packages/plugin/src/configs/schema-all.ts)|enables all rules (except for the rules that require `parserOptions.operations` option)|
194
+ |[`schema-all`](packages/plugin/src/configs/schema-all.ts)|enables all rules, except for those that require `parserOptions.operations` option)|
191
195
  |[`operations-all`](packages/plugin/src/configs/operations-all.ts)|enables all rules|
192
196
  <!-- prettier-ignore-end -->
193
197
 
@@ -13,30 +13,34 @@ export declare const configs: {
13
13
  '@graphql-eslint/lone-schema-definition': string;
14
14
  '@graphql-eslint/naming-convention': (string | {
15
15
  types: string;
16
- fields: string;
17
- overrides: {
18
- EnumValueDefinition: string;
19
- 'FieldDefinition[parent.name.value=Query]': {
20
- forbiddenPrefixes: string[];
21
- forbiddenSuffixes: string[];
22
- };
23
- 'FieldDefinition[parent.name.value=Mutation]': {
24
- forbiddenPrefixes: string[];
25
- forbiddenSuffixes: string[];
26
- };
27
- 'FieldDefinition[parent.name.value=Subscription]': {
28
- forbiddenPrefixes: string[];
29
- forbiddenSuffixes: string[];
30
- };
16
+ FieldDefinition: string;
17
+ InputValueDefinition: string;
18
+ Argument: string;
19
+ DirectiveDefinition: string;
20
+ EnumValueDefinition: string;
21
+ 'FieldDefinition[parent.name.value=Query]': {
22
+ forbiddenPrefixes: string[];
23
+ forbiddenSuffixes: string[];
24
+ };
25
+ 'FieldDefinition[parent.name.value=Mutation]': {
26
+ forbiddenPrefixes: string[];
27
+ forbiddenSuffixes: string[];
28
+ };
29
+ 'FieldDefinition[parent.name.value=Subscription]': {
30
+ forbiddenPrefixes: string[];
31
+ forbiddenSuffixes: string[];
31
32
  };
32
33
  })[];
33
34
  '@graphql-eslint/no-case-insensitive-enum-values-duplicates': string;
34
35
  '@graphql-eslint/no-hashtag-description': string;
35
36
  '@graphql-eslint/no-typename-prefix': string;
36
37
  '@graphql-eslint/no-unreachable-types': string;
37
- '@graphql-eslint/possible-type-extension': string;
38
38
  '@graphql-eslint/provided-required-arguments': string;
39
39
  '@graphql-eslint/require-deprecation-reason': string;
40
+ '@graphql-eslint/require-description': (string | {
41
+ types: boolean;
42
+ DirectiveDefinition: boolean;
43
+ })[];
40
44
  '@graphql-eslint/strict-id-in-types': string;
41
45
  '@graphql-eslint/unique-directive-names': string;
42
46
  '@graphql-eslint/unique-directive-names-per-location': string;
@@ -58,13 +62,8 @@ export declare const configs: {
58
62
  '@graphql-eslint/no-root-type': string;
59
63
  '@graphql-eslint/no-scalar-result-type-on-mutation': string;
60
64
  '@graphql-eslint/no-unused-fields': string;
65
+ '@graphql-eslint/possible-type-extension': string;
61
66
  '@graphql-eslint/require-deprecation-date': string;
62
- '@graphql-eslint/require-description': (string | {
63
- types: boolean;
64
- overrides: {
65
- DirectiveDefinition: boolean;
66
- };
67
- })[];
68
67
  '@graphql-eslint/require-field-of-type-query-in-mutation-result': string;
69
68
  };
70
69
  };
@@ -80,19 +79,16 @@ export declare const configs: {
80
79
  '@graphql-eslint/known-type-names': string;
81
80
  '@graphql-eslint/lone-anonymous-operation': string;
82
81
  '@graphql-eslint/naming-convention': (string | {
83
- overrides: {
84
- Argument: string;
85
- VariableDefinition: string;
86
- OperationDefinition: {
87
- style: string;
88
- forbiddenPrefixes: string[];
89
- forbiddenSuffixes: string[];
90
- };
91
- FragmentDefinition: {
92
- style: string;
93
- forbiddenPrefixes: string[];
94
- forbiddenSuffixes: string[];
95
- };
82
+ VariableDefinition: string;
83
+ OperationDefinition: {
84
+ style: string;
85
+ forbiddenPrefixes: string[];
86
+ forbiddenSuffixes: string[];
87
+ };
88
+ FragmentDefinition: {
89
+ style: string;
90
+ forbiddenPrefixes: string[];
91
+ forbiddenSuffixes: string[];
96
92
  };
97
93
  })[];
98
94
  '@graphql-eslint/no-anonymous-operations': string;
@@ -10,19 +10,16 @@ declare const _default: {
10
10
  '@graphql-eslint/known-type-names': string;
11
11
  '@graphql-eslint/lone-anonymous-operation': string;
12
12
  '@graphql-eslint/naming-convention': (string | {
13
- overrides: {
14
- Argument: string;
15
- VariableDefinition: string;
16
- OperationDefinition: {
17
- style: string;
18
- forbiddenPrefixes: string[];
19
- forbiddenSuffixes: string[];
20
- };
21
- FragmentDefinition: {
22
- style: string;
23
- forbiddenPrefixes: string[];
24
- forbiddenSuffixes: string[];
25
- };
13
+ VariableDefinition: string;
14
+ OperationDefinition: {
15
+ style: string;
16
+ forbiddenPrefixes: string[];
17
+ forbiddenSuffixes: string[];
18
+ };
19
+ FragmentDefinition: {
20
+ style: string;
21
+ forbiddenPrefixes: string[];
22
+ forbiddenSuffixes: string[];
26
23
  };
27
24
  })[];
28
25
  '@graphql-eslint/no-anonymous-operations': string;
@@ -10,13 +10,8 @@ declare const _default: {
10
10
  '@graphql-eslint/no-root-type': string;
11
11
  '@graphql-eslint/no-scalar-result-type-on-mutation': string;
12
12
  '@graphql-eslint/no-unused-fields': string;
13
+ '@graphql-eslint/possible-type-extension': string;
13
14
  '@graphql-eslint/require-deprecation-date': string;
14
- '@graphql-eslint/require-description': (string | {
15
- types: boolean;
16
- overrides: {
17
- DirectiveDefinition: boolean;
18
- };
19
- })[];
20
15
  '@graphql-eslint/require-field-of-type-query-in-mutation-result': string;
21
16
  };
22
17
  };
@@ -8,30 +8,34 @@ declare const _default: {
8
8
  '@graphql-eslint/lone-schema-definition': string;
9
9
  '@graphql-eslint/naming-convention': (string | {
10
10
  types: string;
11
- fields: string;
12
- overrides: {
13
- EnumValueDefinition: string;
14
- 'FieldDefinition[parent.name.value=Query]': {
15
- forbiddenPrefixes: string[];
16
- forbiddenSuffixes: string[];
17
- };
18
- 'FieldDefinition[parent.name.value=Mutation]': {
19
- forbiddenPrefixes: string[];
20
- forbiddenSuffixes: string[];
21
- };
22
- 'FieldDefinition[parent.name.value=Subscription]': {
23
- forbiddenPrefixes: string[];
24
- forbiddenSuffixes: string[];
25
- };
11
+ FieldDefinition: string;
12
+ InputValueDefinition: string;
13
+ Argument: string;
14
+ DirectiveDefinition: string;
15
+ EnumValueDefinition: string;
16
+ 'FieldDefinition[parent.name.value=Query]': {
17
+ forbiddenPrefixes: string[];
18
+ forbiddenSuffixes: string[];
19
+ };
20
+ 'FieldDefinition[parent.name.value=Mutation]': {
21
+ forbiddenPrefixes: string[];
22
+ forbiddenSuffixes: string[];
23
+ };
24
+ 'FieldDefinition[parent.name.value=Subscription]': {
25
+ forbiddenPrefixes: string[];
26
+ forbiddenSuffixes: string[];
26
27
  };
27
28
  })[];
28
29
  '@graphql-eslint/no-case-insensitive-enum-values-duplicates': string;
29
30
  '@graphql-eslint/no-hashtag-description': string;
30
31
  '@graphql-eslint/no-typename-prefix': string;
31
32
  '@graphql-eslint/no-unreachable-types': string;
32
- '@graphql-eslint/possible-type-extension': string;
33
33
  '@graphql-eslint/provided-required-arguments': string;
34
34
  '@graphql-eslint/require-deprecation-reason': string;
35
+ '@graphql-eslint/require-description': (string | {
36
+ types: boolean;
37
+ DirectiveDefinition: boolean;
38
+ })[];
35
39
  '@graphql-eslint/strict-id-in-types': string;
36
40
  '@graphql-eslint/unique-directive-names': string;
37
41
  '@graphql-eslint/unique-directive-names-per-location': string;
package/docs/README.md CHANGED
@@ -31,7 +31,7 @@ Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
31
31
  [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.|🚀||✅
32
32
  [no-fragment-cycles](rules/no-fragment-cycles.md)|A GraphQL fragment is only valid when it does not have cycles in fragments usage.|🔮||✅
33
33
  [no-hashtag-description](rules/no-hashtag-description.md)|Requires to use `"""` or `"` for adding a GraphQL description instead of `#`.|🚀||✅
34
- [no-root-type](rules/no-root-type.md)|Disallow using root types for `read-only` or `write-only` schemas.|🚀||
34
+ [no-root-type](rules/no-root-type.md)|Disallow using root types `mutation` and/or `subscription`.|🚀||
35
35
  [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.|🚀||
36
36
  [no-typename-prefix](rules/no-typename-prefix.md)|Enforces users to avoid using the type name in a field name while defining your schema.|🚀||✅
37
37
  [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.|🔮||✅
@@ -42,11 +42,11 @@ Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
42
42
  [one-field-subscriptions](rules/one-field-subscriptions.md)|A GraphQL subscription is valid only if it contains a single root field.|🔮||✅
43
43
  [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.|🔮||✅
44
44
  [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.|🔮||✅
45
- [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
+ [possible-type-extension](rules/possible-type-extension.md)|A type extension is only valid if the type is defined and has the same kind.|🔮||
46
46
  [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.|🔮||✅
47
47
  [require-deprecation-date](rules/require-deprecation-date.md)|Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date.|🚀||
48
48
  [require-deprecation-reason](rules/require-deprecation-reason.md)|Require all deprecation directives to specify a reason.|🚀||✅
49
- [require-description](rules/require-description.md)|Enforce descriptions in your type definitions.|🚀||
49
+ [require-description](rules/require-description.md)|Enforce descriptions in your type definitions.|🚀||✅
50
50
  [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.|🚀||
51
51
  [require-id-when-available](rules/require-id-when-available.md)|Enforce selecting specific fields when they are available on the GraphQL type.|🚀||✅
52
52
  [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.|🔮||✅
@@ -44,7 +44,7 @@ This element must be one of the following enum values:
44
44
  - `block`
45
45
  - `inline`
46
46
 
47
- Default: `"inline"`
47
+ Default: `"block"`
48
48
 
49
49
  ## Resources
50
50
 
@@ -14,97 +14,223 @@ Require names to follow specified conventions.
14
14
  ### Incorrect
15
15
 
16
16
  ```graphql
17
- # eslint @graphql-eslint/naming-convention: ['error', { types: 'PascalCase', fields: 'camelCase' }]
17
+ # eslint @graphql-eslint/naming-convention: ['error', { types: 'PascalCase', FieldDefinition: 'camelCase' }]
18
18
 
19
19
  type user {
20
20
  first_name: String!
21
21
  }
22
22
  ```
23
23
 
24
+ ### Incorrect
25
+
26
+ ```graphql
27
+ # eslint @graphql-eslint/naming-convention: ['error', { FragmentDefinition: { style: 'PascalCase', forbiddenSuffixes: ['Fragment'] } }]
28
+
29
+ fragment UserFragment on User {
30
+ # ...
31
+ }
32
+ ```
33
+
34
+ ### Incorrect
35
+
36
+ ```graphql
37
+ # eslint @graphql-eslint/naming-convention: ['error', { 'FieldDefinition[parent.name.value=Query]': { forbiddenPrefixes: ['get'] } }]
38
+
39
+ type Query {
40
+ getUsers: [User!]!
41
+ }
42
+ ```
43
+
24
44
  ### Correct
25
45
 
26
46
  ```graphql
27
- # eslint @graphql-eslint/naming-convention: ['error', { types: 'PascalCase', fields: 'camelCase' }]
47
+ # eslint @graphql-eslint/naming-convention: ['error', { types: 'PascalCase', FieldDefinition: 'camelCase' }]
28
48
 
29
49
  type User {
30
50
  firstName: String
31
51
  }
32
52
  ```
33
53
 
54
+ ### Correct
55
+
56
+ ```graphql
57
+ # eslint @graphql-eslint/naming-convention: ['error', { FragmentDefinition: { style: 'PascalCase', forbiddenSuffixes: ['Fragment'] } }]
58
+
59
+ fragment UserFields on User {
60
+ # ...
61
+ }
62
+ ```
63
+
64
+ ### Correct
65
+
66
+ ```graphql
67
+ # eslint @graphql-eslint/naming-convention: ['error', { 'FieldDefinition[parent.name.value=Query]': { forbiddenPrefixes: ['get'] } }]
68
+
69
+ type Query {
70
+ users: [User!]!
71
+ }
72
+ ```
73
+
34
74
  ## Config Schema
35
75
 
76
+ > It's possible to use a [`selector`](https://eslint.org/docs/developer-guide/selectors) that starts with allowed `ASTNode` names which are described below.
77
+ >
78
+ > Paste or drop code into the editor in [ASTExplorer](https://astexplorer.net) and inspect the generated AST to compose your selector.
79
+ >
80
+ > Example: pattern property `FieldDefinition[parent.name.value=Query]` will match only fields for type `Query`.
81
+
36
82
  The schema defines the following properties:
37
83
 
38
84
  ### `types`
39
85
 
40
86
  Includes:
41
87
 
42
- - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
43
- - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
44
- - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
45
- - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
46
- - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
47
- - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
88
+ - `ObjectTypeDefinition`
89
+ - `InterfaceTypeDefinition`
90
+ - `EnumTypeDefinition`
91
+ - `ScalarTypeDefinition`
92
+ - `InputObjectTypeDefinition`
93
+ - `UnionTypeDefinition`
48
94
 
49
95
  The object must be one of the following types:
50
96
 
51
97
  * `asString`
52
98
  * `asObject`
53
99
 
54
- ### `fields`
100
+ ### `Argument`
55
101
 
56
- Includes:
102
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#Argument).
103
+
104
+ The object must be one of the following types:
105
+
106
+ * `asString`
107
+ * `asObject`
57
108
 
58
- - [FieldDefinition](https://spec.graphql.org/October2021/#FieldDefinition)
59
- - [InputValueDefinition](https://spec.graphql.org/October2021/#InputValueDefinition)
60
- - [Argument](https://spec.graphql.org/October2021/#Argument)
61
- - [DirectiveDefinition](https://spec.graphql.org/October2021/#DirectiveDefinition)
109
+ ### `DirectiveDefinition`
110
+
111
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#DirectiveDefinition).
62
112
 
63
113
  The object must be one of the following types:
64
114
 
65
115
  * `asString`
66
116
  * `asObject`
67
117
 
68
- ### `allowLeadingUnderscore` (boolean)
118
+ ### `EnumTypeDefinition`
69
119
 
70
- Default: `false`
120
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumTypeDefinition).
71
121
 
72
- ### `allowTrailingUnderscore` (boolean)
122
+ The object must be one of the following types:
73
123
 
74
- Default: `false`
124
+ * `asString`
125
+ * `asObject`
75
126
 
76
- ### `overrides` (object)
77
-
78
- May contain the following `ASTNode` names:
79
-
80
- - [Argument](https://spec.graphql.org/October2021/#Argument)
81
- - [DirectiveDefinition](https://spec.graphql.org/October2021/#DirectiveDefinition)
82
- - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
83
- - [EnumValueDefinition](https://spec.graphql.org/October2021/#EnumValueDefinition)
84
- - [FieldDefinition](https://spec.graphql.org/October2021/#FieldDefinition)
85
- - [FragmentDefinition](https://spec.graphql.org/October2021/#FragmentDefinition)
86
- - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
87
- - [InputValueDefinition](https://spec.graphql.org/October2021/#InputValueDefinition)
88
- - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
89
- - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
90
- - [OperationDefinition](https://spec.graphql.org/October2021/#OperationDefinition)
91
- - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
92
- - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
93
- - [VariableDefinition](https://spec.graphql.org/October2021/#VariableDefinition)
94
-
95
- > It's also possible to use a [`selector`](https://eslint.org/docs/developer-guide/selectors) that starts with `ASTNode` name
96
- >
97
- > Example: pattern property `FieldDefinition[parent.name.value=Query]` will match only fields for type `Query`
127
+ ### `EnumValueDefinition`
98
128
 
99
- Pattern properties of the `overrides` object:
129
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumValueDefinition).
100
130
 
101
- #### `^(Argument|DirectiveDefinition|EnumTypeDefinition|EnumValueDefinition|FieldDefinition|FragmentDefinition|InputObjectTypeDefinition|InputValueDefinition|InterfaceTypeDefinition|ObjectTypeDefinition|OperationDefinition|ScalarTypeDefinition|UnionTypeDefinition|VariableDefinition)(.+)?$`
131
+ The object must be one of the following types:
132
+
133
+ * `asString`
134
+ * `asObject`
135
+
136
+ ### `FieldDefinition`
137
+
138
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FieldDefinition).
102
139
 
103
140
  The object must be one of the following types:
104
141
 
105
142
  * `asString`
106
143
  * `asObject`
107
144
 
145
+ ### `FragmentDefinition`
146
+
147
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FragmentDefinition).
148
+
149
+ The object must be one of the following types:
150
+
151
+ * `asString`
152
+ * `asObject`
153
+
154
+ ### `InputObjectTypeDefinition`
155
+
156
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputObjectTypeDefinition).
157
+
158
+ The object must be one of the following types:
159
+
160
+ * `asString`
161
+ * `asObject`
162
+
163
+ ### `InputValueDefinition`
164
+
165
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputValueDefinition).
166
+
167
+ The object must be one of the following types:
168
+
169
+ * `asString`
170
+ * `asObject`
171
+
172
+ ### `InterfaceTypeDefinition`
173
+
174
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InterfaceTypeDefinition).
175
+
176
+ The object must be one of the following types:
177
+
178
+ * `asString`
179
+ * `asObject`
180
+
181
+ ### `ObjectTypeDefinition`
182
+
183
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ObjectTypeDefinition).
184
+
185
+ The object must be one of the following types:
186
+
187
+ * `asString`
188
+ * `asObject`
189
+
190
+ ### `OperationDefinition`
191
+
192
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#OperationDefinition).
193
+
194
+ The object must be one of the following types:
195
+
196
+ * `asString`
197
+ * `asObject`
198
+
199
+ ### `ScalarTypeDefinition`
200
+
201
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ScalarTypeDefinition).
202
+
203
+ The object must be one of the following types:
204
+
205
+ * `asString`
206
+ * `asObject`
207
+
208
+ ### `UnionTypeDefinition`
209
+
210
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#UnionTypeDefinition).
211
+
212
+ The object must be one of the following types:
213
+
214
+ * `asString`
215
+ * `asObject`
216
+
217
+ ### `VariableDefinition`
218
+
219
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#VariableDefinition).
220
+
221
+ The object must be one of the following types:
222
+
223
+ * `asString`
224
+ * `asObject`
225
+
226
+ ### `allowLeadingUnderscore` (boolean)
227
+
228
+ Default: `false`
229
+
230
+ ### `allowTrailingUnderscore` (boolean)
231
+
232
+ Default: `false`
233
+
108
234
  ---
109
235
 
110
236
  # Sub Schemas
@@ -5,11 +5,11 @@
5
5
  - Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
6
6
  - Requires GraphQL Operations: `false` [ℹ️](../../README.md#extended-linting-rules-with-siblings-operations)
7
7
 
8
- Disallow using root types for `read-only` or `write-only` schemas.
8
+ Disallow using root types `mutation` and/or `subscription`.
9
9
 
10
10
  ## Usage Examples
11
11
 
12
- ### Incorrect (`read-only` schema)
12
+ ### Incorrect
13
13
 
14
14
  ```graphql
15
15
  # eslint @graphql-eslint/no-root-type: ['error', { disallow: ['mutation', 'subscription'] }]
@@ -19,17 +19,7 @@ type Mutation {
19
19
  }
20
20
  ```
21
21
 
22
- ### Incorrect (`write-only` schema)
23
-
24
- ```graphql
25
- # eslint @graphql-eslint/no-root-type: ['error', { disallow: ['query'] }]
26
-
27
- type Query {
28
- users: [User!]!
29
- }
30
- ```
31
-
32
- ### Correct (`read-only` schema)
22
+ ### Correct
33
23
 
34
24
  ```graphql
35
25
  # eslint @graphql-eslint/no-root-type: ['error', { disallow: ['mutation', 'subscription'] }]
@@ -47,7 +37,6 @@ The schema defines the following properties:
47
37
 
48
38
  The elements of the array can contain the following enum values:
49
39
 
50
- - `query`
51
40
  - `mutation`
52
41
  - `subscription`
53
42
 
@@ -1,7 +1,5 @@
1
1
  # `possible-type-extension`
2
2
 
3
- ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
-
5
3
  - Category: `Schema`
6
4
  - Rule name: `@graphql-eslint/possible-type-extension`
7
5
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
@@ -1,5 +1,7 @@
1
1
  # `require-description`
2
2
 
3
+ ✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
4
+
3
5
  - Category: `Schema`
4
6
  - Rule name: `@graphql-eslint/require-description`
5
7
  - Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
@@ -12,7 +14,7 @@ Enforce descriptions in your type definitions.
12
14
  ### Incorrect
13
15
 
14
16
  ```graphql
15
- # eslint @graphql-eslint/require-description: ['error', { types: true, overrides: { FieldDefinition: true } }]
17
+ # eslint @graphql-eslint/require-description: ['error', { types: true, FieldDefinition: true }]
16
18
 
17
19
  type someTypeName {
18
20
  name: String
@@ -22,7 +24,7 @@ type someTypeName {
22
24
  ### Correct
23
25
 
24
26
  ```graphql
25
- # eslint @graphql-eslint/require-description: ['error', { types: true, overrides: { FieldDefinition: true } }]
27
+ # eslint @graphql-eslint/require-description: ['error', { types: true, FieldDefinition: true }]
26
28
 
27
29
  """
28
30
  Some type description
@@ -43,38 +45,52 @@ The schema defines the following properties:
43
45
 
44
46
  Includes:
45
47
 
46
- - [ObjectTypeDefinition](https://spec.graphql.org/October2021/#ObjectTypeDefinition)
47
- - [InterfaceTypeDefinition](https://spec.graphql.org/October2021/#InterfaceTypeDefinition)
48
- - [EnumTypeDefinition](https://spec.graphql.org/October2021/#EnumTypeDefinition)
49
- - [ScalarTypeDefinition](https://spec.graphql.org/October2021/#ScalarTypeDefinition)
50
- - [InputObjectTypeDefinition](https://spec.graphql.org/October2021/#InputObjectTypeDefinition)
51
- - [UnionTypeDefinition](https://spec.graphql.org/October2021/#UnionTypeDefinition)
48
+ - `ObjectTypeDefinition`
49
+ - `InterfaceTypeDefinition`
50
+ - `EnumTypeDefinition`
51
+ - `ScalarTypeDefinition`
52
+ - `InputObjectTypeDefinition`
53
+ - `UnionTypeDefinition`
54
+
55
+ ### `DirectiveDefinition` (boolean)
56
+
57
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#DirectiveDefinition).
58
+
59
+ ### `EnumTypeDefinition` (boolean)
60
+
61
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumTypeDefinition).
62
+
63
+ ### `EnumValueDefinition` (boolean)
64
+
65
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#EnumValueDefinition).
66
+
67
+ ### `FieldDefinition` (boolean)
52
68
 
53
- ### `overrides` (object)
69
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#FieldDefinition).
54
70
 
55
- Configuration for precise `ASTNode`
71
+ ### `InputObjectTypeDefinition` (boolean)
56
72
 
57
- Properties of the `overrides` object:
73
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputObjectTypeDefinition).
58
74
 
59
- #### `ObjectTypeDefinition` (boolean)
75
+ ### `InputValueDefinition` (boolean)
60
76
 
61
- #### `InterfaceTypeDefinition` (boolean)
77
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InputValueDefinition).
62
78
 
63
- #### `EnumTypeDefinition` (boolean)
79
+ ### `InterfaceTypeDefinition` (boolean)
64
80
 
65
- #### `ScalarTypeDefinition` (boolean)
81
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#InterfaceTypeDefinition).
66
82
 
67
- #### `InputObjectTypeDefinition` (boolean)
83
+ ### `ObjectTypeDefinition` (boolean)
68
84
 
69
- #### `UnionTypeDefinition` (boolean)
85
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ObjectTypeDefinition).
70
86
 
71
- #### `FieldDefinition` (boolean)
87
+ ### `ScalarTypeDefinition` (boolean)
72
88
 
73
- #### `InputValueDefinition` (boolean)
89
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#ScalarTypeDefinition).
74
90
 
75
- #### `EnumValueDefinition` (boolean)
91
+ ### `UnionTypeDefinition` (boolean)
76
92
 
77
- #### `DirectiveDefinition` (boolean)
93
+ Read more about this kind on [spec.graphql.org](https://spec.graphql.org/October2021/#UnionTypeDefinition).
78
94
 
79
95
  ## Resources
80
96