@graphql-eslint/eslint-plugin 3.8.0-alpha-8ddf2a4.0 → 3.9.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 +5 -5
- package/configs/base.json +4 -0
- package/configs/operations-all.json +24 -0
- package/configs/operations-recommended.json +50 -0
- package/configs/schema-all.json +26 -0
- package/configs/schema-recommended.json +49 -0
- package/docs/README.md +59 -57
- package/docs/custom-rules.md +8 -8
- package/docs/parser-options.md +4 -4
- package/docs/parser.md +2 -2
- package/docs/rules/alphabetize.md +11 -5
- package/docs/rules/description-style.md +2 -0
- package/docs/rules/executable-definitions.md +1 -1
- package/docs/rules/fields-on-correct-type.md +1 -1
- package/docs/rules/fragments-on-composite-type.md +1 -1
- package/docs/rules/input-name.md +2 -0
- package/docs/rules/known-argument-names.md +1 -1
- package/docs/rules/known-directives.md +29 -2
- package/docs/rules/known-fragment-names.md +1 -1
- package/docs/rules/known-type-names.md +1 -1
- package/docs/rules/lone-anonymous-operation.md +1 -1
- package/docs/rules/lone-schema-definition.md +1 -1
- package/docs/rules/naming-convention.md +2 -0
- package/docs/rules/no-anonymous-operations.md +2 -0
- package/docs/rules/no-case-insensitive-enum-values-duplicates.md +2 -0
- package/docs/rules/no-deprecated.md +2 -0
- package/docs/rules/no-duplicate-fields.md +2 -0
- package/docs/rules/no-fragment-cycles.md +1 -1
- package/docs/rules/no-hashtag-description.md +2 -0
- package/docs/rules/no-root-type.md +2 -0
- package/docs/rules/no-scalar-result-type-on-mutation.md +2 -0
- package/docs/rules/no-typename-prefix.md +2 -0
- package/docs/rules/no-undefined-variables.md +1 -1
- package/docs/rules/no-unreachable-types.md +2 -0
- package/docs/rules/no-unused-fields.md +2 -0
- package/docs/rules/no-unused-fragments.md +1 -1
- package/docs/rules/no-unused-variables.md +1 -1
- package/docs/rules/one-field-subscriptions.md +1 -1
- package/docs/rules/overlapping-fields-can-be-merged.md +1 -1
- package/docs/rules/possible-fragment-spread.md +1 -1
- package/docs/rules/possible-type-extension.md +1 -1
- package/docs/rules/provided-required-arguments.md +1 -1
- package/docs/rules/require-deprecation-date.md +2 -0
- package/docs/rules/require-id-when-available.md +2 -0
- package/docs/rules/scalar-leafs.md +1 -1
- package/docs/rules/selection-set-depth.md +2 -0
- package/docs/rules/unique-argument-names.md +1 -1
- package/docs/rules/unique-directive-names-per-location.md +1 -1
- package/docs/rules/unique-directive-names.md +1 -1
- package/docs/rules/unique-enum-value-names.md +1 -1
- package/docs/rules/unique-field-definition-names.md +1 -1
- package/docs/rules/unique-input-field-names.md +1 -1
- package/docs/rules/unique-operation-types.md +1 -1
- package/docs/rules/unique-type-names.md +1 -1
- package/docs/rules/unique-variable-names.md +1 -1
- package/docs/rules/value-literals-of-correct-type.md +1 -1
- package/docs/rules/variables-are-input-types.md +1 -1
- package/docs/rules/variables-in-allowed-position.md +1 -1
- package/estree-parser/converter.d.ts +3 -2
- package/estree-parser/estree-ast.d.ts +18 -18
- package/estree-parser/utils.d.ts +5 -9
- package/index.d.ts +6 -2
- package/index.js +699 -694
- package/index.mjs +699 -688
- package/package.json +1 -1
- package/rules/alphabetize.d.ts +1 -0
- package/rules/graphql-js-validation.d.ts +1 -1
- package/rules/index.d.ts +1 -4
- package/rules/selection-set-depth.d.ts +1 -1
- package/sibling-operations.d.ts +3 -3
- package/testkit.d.ts +3 -3
- package/types.d.ts +24 -18
- package/utils.d.ts +14 -4
- package/configs/base.d.ts +0 -5
- package/configs/index.d.ts +0 -133
- package/configs/operations-all.d.ts +0 -19
- package/configs/operations-recommended.d.ts +0 -50
- package/configs/schema-all.d.ts +0 -15
- package/configs/schema-recommended.d.ts +0 -47
- package/graphql-ast.d.ts +0 -6
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if it contains only one schema definition.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` and `"plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Schema & Operations`
|
6
8
|
- Rule name: `@graphql-eslint/naming-convention`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Operations`
|
6
8
|
- Rule name: `@graphql-eslint/no-anonymous-operations`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Schema`
|
6
8
|
- Rule name: `@graphql-eslint/no-case-insensitive-enum-values-duplicates`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Operations`
|
6
8
|
- Rule name: `@graphql-eslint/no-deprecated`
|
7
9
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Operations`
|
6
8
|
- Rule name: `@graphql-eslint/no-duplicate-fields`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Schema`
|
6
8
|
- Rule name: `@graphql-eslint/no-hashtag-description`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# `no-root-type`
|
2
2
|
|
3
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
4
|
+
|
3
5
|
- Category: `Schema`
|
4
6
|
- Rule name: `@graphql-eslint/no-root-type`
|
5
7
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# `no-scalar-result-type-on-mutation`
|
2
2
|
|
3
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
4
|
+
|
3
5
|
- Category: `Schema`
|
4
6
|
- Rule name: `@graphql-eslint/no-scalar-result-type-on-mutation`
|
5
7
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Schema`
|
6
8
|
- Rule name: `@graphql-eslint/no-typename-prefix`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/schema-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Schema`
|
6
8
|
- Rule name: `@graphql-eslint/no-unreachable-types`
|
7
9
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# `no-unused-fields`
|
2
2
|
|
3
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
4
|
+
|
3
5
|
- Category: `Schema`
|
4
6
|
- Rule name: `@graphql-eslint/no-unused-fields`
|
5
7
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
A type extension is only valid if the type is defined and has the same kind.
|
9
9
|
|
10
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
10
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
11
11
|
|
12
12
|
## Resources
|
13
13
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# `require-deprecation-date`
|
2
2
|
|
3
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
4
|
+
|
3
5
|
- Category: `Schema`
|
4
6
|
- Rule name: `@graphql-eslint/require-deprecation-date`
|
5
7
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Operations`
|
6
8
|
- Rule name: `@graphql-eslint/require-id-when-available`
|
7
9
|
- Requires GraphQL Schema: `true` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
✅ The `"extends": "plugin:@graphql-eslint/operations-recommended"` property in a configuration file enables this rule.
|
4
4
|
|
5
|
+
💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
|
6
|
+
|
5
7
|
- Category: `Operations`
|
6
8
|
- Rule name: `@graphql-eslint/selection-set-depth`
|
7
9
|
- Requires GraphQL Schema: `false` [ℹ️](../../README.md#extended-linting-rules-with-graphql-schema)
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
A GraphQL enum type is only valid if all its values are uniquely named.
|
9
9
|
|
10
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
10
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
11
11
|
|
12
12
|
## Resources
|
13
13
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
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.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
A GraphQL document is only valid if all value literals are of the type expected at their position.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object).
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
Variables passed to field arguments conform to type.
|
11
11
|
|
12
|
-
> This rule is a wrapper around a `graphql-js` validation function.
|
12
|
+
> This rule is a wrapper around a `graphql-js` validation function.
|
13
13
|
|
14
14
|
## Resources
|
15
15
|
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { GraphQLESTreeNode } from './estree-ast';
|
2
1
|
import { ASTNode, TypeInfo } from 'graphql';
|
2
|
+
import { Comment } from 'estree';
|
3
|
+
import { GraphQLESTreeNode } from './estree-ast';
|
3
4
|
export declare function convertToESTree<T extends ASTNode>(node: T, typeInfo?: TypeInfo): {
|
4
5
|
rootTree: GraphQLESTreeNode<T, false>;
|
5
|
-
comments:
|
6
|
+
comments: Comment[];
|
6
7
|
};
|
@@ -1,27 +1,27 @@
|
|
1
1
|
import { ASTNode, TypeInfo, TypeNode, ValueNode } from 'graphql';
|
2
2
|
import { BaseNode } from 'estree';
|
3
|
-
|
3
|
+
declare type SafeGraphQLType<T extends ASTNode | ValueNode> = Omit<T extends {
|
4
4
|
readonly type: TypeNode;
|
5
5
|
} ? Omit<T, 'type'> & {
|
6
6
|
readonly gqlType: TypeNode;
|
7
7
|
} : T, 'loc'>;
|
8
|
-
export declare type
|
8
|
+
export declare type TypeInformation = {
|
9
|
+
argument: ReturnType<TypeInfo['getArgument']>;
|
10
|
+
defaultValue: ReturnType<TypeInfo['getDefaultValue']>;
|
11
|
+
directive: ReturnType<TypeInfo['getDirective']>;
|
12
|
+
enumValue: ReturnType<TypeInfo['getEnumValue']>;
|
13
|
+
fieldDef: ReturnType<TypeInfo['getFieldDef']>;
|
14
|
+
inputType: ReturnType<TypeInfo['getInputType']>;
|
15
|
+
parentInputType: ReturnType<TypeInfo['getParentInputType']>;
|
16
|
+
parentType: ReturnType<TypeInfo['getParentType']>;
|
17
|
+
gqlType: ReturnType<TypeInfo['getType']>;
|
18
|
+
};
|
19
|
+
declare type SingleESTreeNode<T extends ASTNode | ValueNode, WithTypeInfo extends boolean> = SafeGraphQLType<T> & Pick<BaseNode, 'leadingComments' | 'loc' | 'range'> & {
|
9
20
|
type: T['kind'];
|
10
|
-
|
11
|
-
typeInfo?: () => {
|
12
|
-
argument?: ReturnType<TypeInfo['getArgument']>;
|
13
|
-
defaultValue?: ReturnType<TypeInfo['getDefaultValue']>;
|
14
|
-
directive?: ReturnType<TypeInfo['getDirective']>;
|
15
|
-
enumValue?: ReturnType<TypeInfo['getEnumValue']>;
|
16
|
-
fieldDef?: ReturnType<TypeInfo['getFieldDef']>;
|
17
|
-
inputType?: ReturnType<TypeInfo['getInputType']>;
|
18
|
-
parentInputType?: ReturnType<TypeInfo['getParentInputType']>;
|
19
|
-
parentType?: ReturnType<TypeInfo['getParentType']>;
|
20
|
-
gqlType?: ReturnType<TypeInfo['getType']>;
|
21
|
-
};
|
22
|
-
} : {}) : T;
|
23
|
-
export declare type GraphQLESTreeNode<T, WithTypeInfo extends boolean = false> = T extends ASTNode | ValueNode ? {
|
21
|
+
typeInfo: () => WithTypeInfo extends true ? TypeInformation : {};
|
24
22
|
rawNode: () => T;
|
25
|
-
}
|
23
|
+
};
|
24
|
+
export declare type GraphQLESTreeNode<T, WithTypeInfo extends boolean = false> = {} & (T extends ASTNode | ValueNode ? {
|
26
25
|
[K in keyof SingleESTreeNode<T, WithTypeInfo>]: SingleESTreeNode<T, WithTypeInfo>[K] extends ReadonlyArray<infer Nested> ? GraphQLESTreeNode<Nested, WithTypeInfo>[] : SingleESTreeNode<T, WithTypeInfo>[K] extends ASTNode ? GraphQLESTreeNode<SingleESTreeNode<T, WithTypeInfo>[K], WithTypeInfo> : SingleESTreeNode<T, WithTypeInfo>[K];
|
27
|
-
} : T;
|
26
|
+
} : T);
|
27
|
+
export {};
|
package/estree-parser/utils.d.ts
CHANGED
@@ -1,16 +1,12 @@
|
|
1
|
-
import { Location,
|
1
|
+
import { Location, GraphQLOutputType, GraphQLNamedType, Token, Source } from 'graphql';
|
2
2
|
import type { Comment } from 'estree';
|
3
3
|
import type { AST } from 'eslint';
|
4
|
-
|
5
|
-
export default function keyValMap<T, V>(list: ReadonlyArray<T>, keyFn: (item: T) => string, valFn: (item: T) => V): Record<string, V>;
|
6
|
-
export declare function valueFromNode(valueNode: GraphQLESTreeNode<ValueNode>, variables?: Record<string, any>): any;
|
4
|
+
export declare const valueFromNode: (valueNode: import("graphql").ValueNode, variables?: import("graphql/jsutils/ObjMap").ObjMap<unknown>) => any;
|
7
5
|
export declare function getBaseType(type: GraphQLOutputType): GraphQLNamedType;
|
8
|
-
|
6
|
+
declare type TokenKindValue = '<SOF>' | '!' | '$' | '&' | '(' | ')' | '...' | ':' | '=' | '@' | '[' | ']' | '{' | '|' | '}' | 'Name' | 'Int' | 'Float' | 'String' | 'BlockString' | 'Comment';
|
7
|
+
export declare function convertToken<T extends 'Line' | 'Block' | TokenKindValue>(token: Token, type: T): Omit<AST.Token, 'type'> & {
|
9
8
|
type: T;
|
10
9
|
};
|
11
10
|
export declare function extractTokens(source: Source): AST.Token[];
|
12
11
|
export declare function extractCommentsFromAst(loc: Location): Comment[];
|
13
|
-
export
|
14
|
-
readonly description?: StringValueNode;
|
15
|
-
};
|
16
|
-
export declare function convertDescription<T extends ASTNode>(node: T): Comment[];
|
12
|
+
export {};
|
package/index.d.ts
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
export { configs } from './configs';
|
2
1
|
export { rules } from './rules';
|
3
2
|
export { processors } from './processors';
|
4
3
|
export * from './parser';
|
5
4
|
export * from './types';
|
6
|
-
export * from './estree-parser';
|
7
5
|
export * from './testkit';
|
6
|
+
export { requireGraphQLSchemaFromContext, requireSiblingsOperations } from './utils';
|
7
|
+
export declare const configs: {
|
8
|
+
[k: string]: {
|
9
|
+
extends: string;
|
10
|
+
};
|
11
|
+
};
|