graphql 16.2.0 → 16.3.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/error/GraphQLError.d.ts +17 -1
- package/error/GraphQLError.js +24 -9
- package/error/GraphQLError.mjs +24 -18
- package/execution/collectFields.d.ts +2 -2
- package/execution/collectFields.js +2 -2
- package/execution/collectFields.mjs +1 -1
- package/execution/execute.d.ts +5 -5
- package/execution/execute.js +12 -12
- package/execution/execute.mjs +14 -14
- package/execution/index.d.ts +1 -1
- package/execution/index.js +6 -0
- package/execution/index.mjs +1 -1
- package/execution/subscribe.d.ts +1 -1
- package/execution/subscribe.js +4 -4
- package/execution/subscribe.mjs +2 -2
- package/execution/values.d.ts +3 -5
- package/execution/values.js +4 -6
- package/execution/values.mjs +2 -4
- package/graphql.js +4 -4
- package/graphql.mjs +1 -1
- package/index.d.ts +3 -62
- package/index.js +6 -0
- package/index.mjs +60 -114
- package/jsutils/promiseReduce.mjs +1 -1
- package/language/index.d.ts +0 -1
- package/language/lexer.d.ts +1 -1
- package/language/lexer.js +2 -2
- package/language/lexer.mjs +2 -2
- package/language/parser.d.ts +40 -40
- package/language/parser.js +6 -6
- package/language/parser.mjs +4 -4
- package/language/predicates.d.ts +4 -4
- package/language/printLocation.d.ts +1 -1
- package/language/printLocation.mjs +1 -1
- package/language/printer.js +2 -2
- package/language/printer.mjs +1 -1
- package/language/source.js +2 -2
- package/language/source.mjs +1 -1
- package/language/visitor.js +10 -12
- package/language/visitor.mjs +9 -11
- package/package.json +1 -1
- package/type/assertName.mjs +1 -1
- package/type/definition.d.ts +14 -14
- package/type/definition.js +11 -11
- package/type/definition.mjs +8 -13
- package/type/directives.js +6 -6
- package/type/directives.mjs +4 -4
- package/type/index.d.ts +1 -28
- package/type/index.mjs +23 -42
- package/type/introspection.d.ts +2 -2
- package/type/introspection.js +4 -4
- package/type/introspection.mjs +8 -8
- package/type/scalars.js +2 -2
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +3 -3
- package/type/schema.js +6 -6
- package/type/schema.mjs +7 -7
- package/type/validate.js +4 -4
- package/type/validate.mjs +7 -7
- package/utilities/TypeInfo.d.ts +9 -9
- package/utilities/TypeInfo.js +2 -2
- package/utilities/TypeInfo.mjs +7 -7
- package/utilities/astFromValue.js +4 -4
- package/utilities/astFromValue.mjs +3 -3
- package/utilities/buildASTSchema.d.ts +1 -1
- package/utilities/buildASTSchema.js +2 -2
- package/utilities/buildASTSchema.mjs +2 -2
- package/utilities/buildClientSchema.js +7 -7
- package/utilities/buildClientSchema.mjs +15 -15
- package/utilities/coerceInputValue.js +5 -5
- package/utilities/coerceInputValue.mjs +5 -5
- package/utilities/extendSchema.d.ts +1 -1
- package/utilities/extendSchema.js +10 -10
- package/utilities/extendSchema.mjs +31 -31
- package/utilities/findBreakingChanges.js +5 -20
- package/utilities/findBreakingChanges.mjs +9 -20
- package/utilities/getIntrospectionQuery.d.ts +4 -0
- package/utilities/getIntrospectionQuery.js +4 -0
- package/utilities/getIntrospectionQuery.mjs +4 -0
- package/utilities/getOperationRootType.d.ts +1 -1
- package/utilities/index.d.ts +0 -25
- package/utilities/index.mjs +21 -44
- package/utilities/introspectionFromSchema.d.ts +1 -1
- package/utilities/lexicographicSortSchema.js +2 -2
- package/utilities/lexicographicSortSchema.mjs +10 -10
- package/utilities/printSchema.d.ts +1 -1
- package/utilities/printSchema.js +5 -5
- package/utilities/printSchema.mjs +11 -11
- package/utilities/sortValueNode.d.ts +9 -0
- package/utilities/sortValueNode.js +47 -0
- package/utilities/sortValueNode.mjs +39 -0
- package/utilities/stripIgnoredCharacters.js +4 -4
- package/utilities/stripIgnoredCharacters.mjs +3 -3
- package/utilities/typeComparators.d.ts +1 -1
- package/utilities/typeComparators.mjs +3 -3
- package/utilities/typeFromAST.d.ts +4 -4
- package/utilities/typeFromAST.mjs +0 -8
- package/utilities/valueFromAST.d.ts +1 -1
- package/utilities/valueFromAST.js +2 -2
- package/utilities/valueFromAST.mjs +3 -3
- package/utilities/valueFromASTUntyped.d.ts +1 -1
- package/utilities/valueFromASTUntyped.mjs +1 -1
- package/validation/ValidationContext.d.ts +10 -10
- package/validation/index.d.ts +0 -29
- package/validation/index.mjs +29 -58
- package/validation/rules/FieldsOnCorrectTypeRule.js +2 -2
- package/validation/rules/FieldsOnCorrectTypeRule.mjs +3 -3
- package/validation/rules/KnownArgumentNamesRule.d.ts +1 -1
- package/validation/rules/KnownDirectivesRule.d.ts +1 -1
- package/validation/rules/KnownDirectivesRule.js +2 -2
- package/validation/rules/KnownDirectivesRule.mjs +1 -1
- package/validation/rules/KnownTypeNamesRule.d.ts +1 -1
- package/validation/rules/KnownTypeNamesRule.js +2 -2
- package/validation/rules/KnownTypeNamesRule.mjs +1 -1
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +42 -38
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +42 -41
- package/validation/rules/PossibleFragmentSpreadsRule.js +2 -2
- package/validation/rules/PossibleFragmentSpreadsRule.mjs +1 -1
- package/validation/rules/PossibleTypeExtensionsRule.js +2 -2
- package/validation/rules/PossibleTypeExtensionsRule.mjs +5 -5
- package/validation/rules/ProvidedRequiredArgumentsRule.d.ts +1 -1
- package/validation/rules/ProvidedRequiredArgumentsRule.js +2 -2
- package/validation/rules/ProvidedRequiredArgumentsRule.mjs +1 -1
- package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +2 -2
- package/validation/rules/ValuesOfCorrectTypeRule.js +2 -2
- package/validation/rules/ValuesOfCorrectTypeRule.mjs +5 -5
- package/validation/rules/VariablesInAllowedPositionRule.js +2 -2
- package/validation/rules/VariablesInAllowedPositionRule.mjs +1 -1
- package/validation/specifiedRules.d.ts +1 -1
- package/validation/specifiedRules.js +47 -47
- package/validation/specifiedRules.mjs +41 -41
- package/version.js +2 -2
- package/version.mjs +2 -2
|
@@ -15,6 +15,8 @@ var _printer = require('../../language/printer.js');
|
|
|
15
15
|
|
|
16
16
|
var _definition = require('../../type/definition.js');
|
|
17
17
|
|
|
18
|
+
var _sortValueNode = require('../../utilities/sortValueNode.js');
|
|
19
|
+
|
|
18
20
|
var _typeFromAST = require('../../utilities/typeFromAST.js');
|
|
19
21
|
|
|
20
22
|
function reasonMessage(reason) {
|
|
@@ -227,6 +229,22 @@ function collectConflictsBetweenFieldsAndFragment(
|
|
|
227
229
|
// and any fragment names found in the given fragment.
|
|
228
230
|
|
|
229
231
|
for (const referencedFragmentName of referencedFragmentNames) {
|
|
232
|
+
// Memoize so two fragments are not compared for conflicts more than once.
|
|
233
|
+
if (
|
|
234
|
+
comparedFragmentPairs.has(
|
|
235
|
+
referencedFragmentName,
|
|
236
|
+
fragmentName,
|
|
237
|
+
areMutuallyExclusive,
|
|
238
|
+
)
|
|
239
|
+
) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
comparedFragmentPairs.add(
|
|
244
|
+
referencedFragmentName,
|
|
245
|
+
fragmentName,
|
|
246
|
+
areMutuallyExclusive,
|
|
247
|
+
);
|
|
230
248
|
collectConflictsBetweenFieldsAndFragment(
|
|
231
249
|
context,
|
|
232
250
|
conflicts,
|
|
@@ -511,8 +529,6 @@ function findConflict(
|
|
|
511
529
|
(0, _definition.isObjectType)(parentType2));
|
|
512
530
|
|
|
513
531
|
if (!areMutuallyExclusive) {
|
|
514
|
-
var _node1$arguments, _node2$arguments;
|
|
515
|
-
|
|
516
532
|
// Two aliases must refer to the same field.
|
|
517
533
|
const name1 = node1.name.value;
|
|
518
534
|
const name2 = node2.name.value;
|
|
@@ -523,22 +539,9 @@ function findConflict(
|
|
|
523
539
|
[node1],
|
|
524
540
|
[node2],
|
|
525
541
|
];
|
|
526
|
-
} //
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
/* c8 ignore next */
|
|
530
|
-
(_node1$arguments = node1.arguments) !== null &&
|
|
531
|
-
_node1$arguments !== void 0
|
|
532
|
-
? _node1$arguments
|
|
533
|
-
: [];
|
|
534
|
-
const args2 =
|
|
535
|
-
/* c8 ignore next */
|
|
536
|
-
(_node2$arguments = node2.arguments) !== null &&
|
|
537
|
-
_node2$arguments !== void 0
|
|
538
|
-
? _node2$arguments
|
|
539
|
-
: []; // Two field calls must have the same arguments.
|
|
540
|
-
|
|
541
|
-
if (!sameArguments(args1, args2)) {
|
|
542
|
+
} // Two field calls must have the same arguments.
|
|
543
|
+
|
|
544
|
+
if (stringifyArguments(node1) !== stringifyArguments(node2)) {
|
|
542
545
|
return [
|
|
543
546
|
[responseName, 'they have differing arguments'],
|
|
544
547
|
[node1],
|
|
@@ -583,26 +586,27 @@ function findConflict(
|
|
|
583
586
|
}
|
|
584
587
|
}
|
|
585
588
|
|
|
586
|
-
function
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
589
|
+
function stringifyArguments(fieldNode) {
|
|
590
|
+
var _fieldNode$arguments;
|
|
591
|
+
|
|
592
|
+
// FIXME https://github.com/graphql/graphql-js/issues/2203
|
|
593
|
+
const args =
|
|
594
|
+
/* c8 ignore next */
|
|
595
|
+
(_fieldNode$arguments = fieldNode.arguments) !== null &&
|
|
596
|
+
_fieldNode$arguments !== void 0
|
|
597
|
+
? _fieldNode$arguments
|
|
598
|
+
: [];
|
|
599
|
+
const inputObjectWithArgs = {
|
|
600
|
+
kind: _kinds.Kind.OBJECT,
|
|
601
|
+
fields: args.map((argNode) => ({
|
|
602
|
+
kind: _kinds.Kind.OBJECT_FIELD,
|
|
603
|
+
name: argNode.name,
|
|
604
|
+
value: argNode.value,
|
|
605
|
+
})),
|
|
606
|
+
};
|
|
607
|
+
return (0, _printer.print)(
|
|
608
|
+
(0, _sortValueNode.sortValueNode)(inputObjectWithArgs),
|
|
609
|
+
);
|
|
606
610
|
} // Two types conflict if both types could not apply to a value simultaneously.
|
|
607
611
|
// Composite types are ignored as their individual field types will be compared
|
|
608
612
|
// later recursively. However List and Non-Null types must match.
|
|
@@ -4,12 +4,13 @@ import { Kind } from '../../language/kinds.mjs';
|
|
|
4
4
|
import { print } from '../../language/printer.mjs';
|
|
5
5
|
import {
|
|
6
6
|
getNamedType,
|
|
7
|
-
|
|
7
|
+
isInterfaceType,
|
|
8
8
|
isLeafType,
|
|
9
|
-
isObjectType,
|
|
10
9
|
isListType,
|
|
11
|
-
|
|
10
|
+
isNonNullType,
|
|
11
|
+
isObjectType,
|
|
12
12
|
} from '../../type/definition.mjs';
|
|
13
|
+
import { sortValueNode } from '../../utilities/sortValueNode.mjs';
|
|
13
14
|
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
|
|
14
15
|
|
|
15
16
|
function reasonMessage(reason) {
|
|
@@ -222,6 +223,22 @@ function collectConflictsBetweenFieldsAndFragment(
|
|
|
222
223
|
// and any fragment names found in the given fragment.
|
|
223
224
|
|
|
224
225
|
for (const referencedFragmentName of referencedFragmentNames) {
|
|
226
|
+
// Memoize so two fragments are not compared for conflicts more than once.
|
|
227
|
+
if (
|
|
228
|
+
comparedFragmentPairs.has(
|
|
229
|
+
referencedFragmentName,
|
|
230
|
+
fragmentName,
|
|
231
|
+
areMutuallyExclusive,
|
|
232
|
+
)
|
|
233
|
+
) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
comparedFragmentPairs.add(
|
|
238
|
+
referencedFragmentName,
|
|
239
|
+
fragmentName,
|
|
240
|
+
areMutuallyExclusive,
|
|
241
|
+
);
|
|
225
242
|
collectConflictsBetweenFieldsAndFragment(
|
|
226
243
|
context,
|
|
227
244
|
conflicts,
|
|
@@ -506,8 +523,6 @@ function findConflict(
|
|
|
506
523
|
isObjectType(parentType2));
|
|
507
524
|
|
|
508
525
|
if (!areMutuallyExclusive) {
|
|
509
|
-
var _node1$arguments, _node2$arguments;
|
|
510
|
-
|
|
511
526
|
// Two aliases must refer to the same field.
|
|
512
527
|
const name1 = node1.name.value;
|
|
513
528
|
const name2 = node2.name.value;
|
|
@@ -518,22 +533,9 @@ function findConflict(
|
|
|
518
533
|
[node1],
|
|
519
534
|
[node2],
|
|
520
535
|
];
|
|
521
|
-
} //
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/* c8 ignore next */
|
|
525
|
-
(_node1$arguments = node1.arguments) !== null &&
|
|
526
|
-
_node1$arguments !== void 0
|
|
527
|
-
? _node1$arguments
|
|
528
|
-
: [];
|
|
529
|
-
const args2 =
|
|
530
|
-
/* c8 ignore next */
|
|
531
|
-
(_node2$arguments = node2.arguments) !== null &&
|
|
532
|
-
_node2$arguments !== void 0
|
|
533
|
-
? _node2$arguments
|
|
534
|
-
: []; // Two field calls must have the same arguments.
|
|
535
|
-
|
|
536
|
-
if (!sameArguments(args1, args2)) {
|
|
536
|
+
} // Two field calls must have the same arguments.
|
|
537
|
+
|
|
538
|
+
if (stringifyArguments(node1) !== stringifyArguments(node2)) {
|
|
537
539
|
return [
|
|
538
540
|
[responseName, 'they have differing arguments'],
|
|
539
541
|
[node1],
|
|
@@ -578,26 +580,25 @@ function findConflict(
|
|
|
578
580
|
}
|
|
579
581
|
}
|
|
580
582
|
|
|
581
|
-
function
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return print(value1) === print(value2);
|
|
583
|
+
function stringifyArguments(fieldNode) {
|
|
584
|
+
var _fieldNode$arguments;
|
|
585
|
+
|
|
586
|
+
// FIXME https://github.com/graphql/graphql-js/issues/2203
|
|
587
|
+
const args =
|
|
588
|
+
/* c8 ignore next */
|
|
589
|
+
(_fieldNode$arguments = fieldNode.arguments) !== null &&
|
|
590
|
+
_fieldNode$arguments !== void 0
|
|
591
|
+
? _fieldNode$arguments
|
|
592
|
+
: [];
|
|
593
|
+
const inputObjectWithArgs = {
|
|
594
|
+
kind: Kind.OBJECT,
|
|
595
|
+
fields: args.map((argNode) => ({
|
|
596
|
+
kind: Kind.OBJECT_FIELD,
|
|
597
|
+
name: argNode.name,
|
|
598
|
+
value: argNode.value,
|
|
599
|
+
})),
|
|
600
|
+
};
|
|
601
|
+
return print(sortValueNode(inputObjectWithArgs));
|
|
601
602
|
} // Two types conflict if both types could not apply to a value simultaneously.
|
|
602
603
|
// Composite types are ignored as their individual field types will be compared
|
|
603
604
|
// later recursively. However List and Non-Null types must match.
|
|
@@ -11,10 +11,10 @@ var _GraphQLError = require('../../error/GraphQLError.js');
|
|
|
11
11
|
|
|
12
12
|
var _definition = require('../../type/definition.js');
|
|
13
13
|
|
|
14
|
-
var _typeFromAST = require('../../utilities/typeFromAST.js');
|
|
15
|
-
|
|
16
14
|
var _typeComparators = require('../../utilities/typeComparators.js');
|
|
17
15
|
|
|
16
|
+
var _typeFromAST = require('../../utilities/typeFromAST.js');
|
|
17
|
+
|
|
18
18
|
/**
|
|
19
19
|
* Possible fragment spread
|
|
20
20
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { inspect } from '../../jsutils/inspect.mjs';
|
|
2
2
|
import { GraphQLError } from '../../error/GraphQLError.mjs';
|
|
3
3
|
import { isCompositeType } from '../../type/definition.mjs';
|
|
4
|
-
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
|
|
5
4
|
import { doTypesOverlap } from '../../utilities/typeComparators.mjs';
|
|
5
|
+
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Possible fragment spread
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
5
5
|
});
|
|
6
6
|
exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule;
|
|
7
7
|
|
|
8
|
+
var _didYouMean = require('../../jsutils/didYouMean.js');
|
|
9
|
+
|
|
8
10
|
var _inspect = require('../../jsutils/inspect.js');
|
|
9
11
|
|
|
10
12
|
var _invariant = require('../../jsutils/invariant.js');
|
|
11
13
|
|
|
12
|
-
var _didYouMean = require('../../jsutils/didYouMean.js');
|
|
13
|
-
|
|
14
14
|
var _suggestionList = require('../../jsutils/suggestionList.js');
|
|
15
15
|
|
|
16
16
|
var _GraphQLError = require('../../error/GraphQLError.js');
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { didYouMean } from '../../jsutils/didYouMean.mjs';
|
|
1
2
|
import { inspect } from '../../jsutils/inspect.mjs';
|
|
2
3
|
import { invariant } from '../../jsutils/invariant.mjs';
|
|
3
|
-
import { didYouMean } from '../../jsutils/didYouMean.mjs';
|
|
4
4
|
import { suggestionList } from '../../jsutils/suggestionList.mjs';
|
|
5
5
|
import { GraphQLError } from '../../error/GraphQLError.mjs';
|
|
6
6
|
import { Kind } from '../../language/kinds.mjs';
|
|
7
7
|
import { isTypeDefinitionNode } from '../../language/predicates.mjs';
|
|
8
8
|
import {
|
|
9
|
-
isScalarType,
|
|
10
|
-
isObjectType,
|
|
11
|
-
isInterfaceType,
|
|
12
|
-
isUnionType,
|
|
13
9
|
isEnumType,
|
|
14
10
|
isInputObjectType,
|
|
11
|
+
isInterfaceType,
|
|
12
|
+
isObjectType,
|
|
13
|
+
isScalarType,
|
|
14
|
+
isUnionType,
|
|
15
15
|
} from '../../type/definition.mjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -17,10 +17,10 @@ var _kinds = require('../../language/kinds.js');
|
|
|
17
17
|
|
|
18
18
|
var _printer = require('../../language/printer.js');
|
|
19
19
|
|
|
20
|
-
var _directives = require('../../type/directives.js');
|
|
21
|
-
|
|
22
20
|
var _definition = require('../../type/definition.js');
|
|
23
21
|
|
|
22
|
+
var _directives = require('../../type/directives.js');
|
|
23
|
+
|
|
24
24
|
/**
|
|
25
25
|
* Provided required arguments
|
|
26
26
|
*
|
|
@@ -3,8 +3,8 @@ import { keyMap } from '../../jsutils/keyMap.mjs';
|
|
|
3
3
|
import { GraphQLError } from '../../error/GraphQLError.mjs';
|
|
4
4
|
import { Kind } from '../../language/kinds.mjs';
|
|
5
5
|
import { print } from '../../language/printer.mjs';
|
|
6
|
+
import { isRequiredArgument, isType } from '../../type/definition.mjs';
|
|
6
7
|
import { specifiedDirectives } from '../../type/directives.mjs';
|
|
7
|
-
import { isType, isRequiredArgument } from '../../type/definition.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Provided required arguments
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _didYouMean = require('../../jsutils/didYouMean.js');
|
|
9
9
|
|
|
10
10
|
var _inspect = require('../../jsutils/inspect.js');
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _keyMap = require('../../jsutils/keyMap.js');
|
|
13
13
|
|
|
14
14
|
var _suggestionList = require('../../jsutils/suggestionList.js');
|
|
15
15
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { keyMap } from '../../jsutils/keyMap.mjs';
|
|
2
|
-
import { inspect } from '../../jsutils/inspect.mjs';
|
|
3
1
|
import { didYouMean } from '../../jsutils/didYouMean.mjs';
|
|
2
|
+
import { inspect } from '../../jsutils/inspect.mjs';
|
|
3
|
+
import { keyMap } from '../../jsutils/keyMap.mjs';
|
|
4
4
|
import { suggestionList } from '../../jsutils/suggestionList.mjs';
|
|
5
5
|
import { GraphQLError } from '../../error/GraphQLError.mjs';
|
|
6
6
|
import { print } from '../../language/printer.mjs';
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
getNamedType,
|
|
9
|
+
getNullableType,
|
|
9
10
|
isInputObjectType,
|
|
11
|
+
isLeafType,
|
|
10
12
|
isListType,
|
|
11
13
|
isNonNullType,
|
|
12
14
|
isRequiredInputField,
|
|
13
|
-
getNullableType,
|
|
14
|
-
getNamedType,
|
|
15
15
|
} from '../../type/definition.mjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -13,10 +13,10 @@ var _kinds = require('../../language/kinds.js');
|
|
|
13
13
|
|
|
14
14
|
var _definition = require('../../type/definition.js');
|
|
15
15
|
|
|
16
|
-
var _typeFromAST = require('../../utilities/typeFromAST.js');
|
|
17
|
-
|
|
18
16
|
var _typeComparators = require('../../utilities/typeComparators.js');
|
|
19
17
|
|
|
18
|
+
var _typeFromAST = require('../../utilities/typeFromAST.js');
|
|
19
|
+
|
|
20
20
|
/**
|
|
21
21
|
* Variables in allowed position
|
|
22
22
|
*
|
|
@@ -2,8 +2,8 @@ import { inspect } from '../../jsutils/inspect.mjs';
|
|
|
2
2
|
import { GraphQLError } from '../../error/GraphQLError.mjs';
|
|
3
3
|
import { Kind } from '../../language/kinds.mjs';
|
|
4
4
|
import { isNonNullType } from '../../type/definition.mjs';
|
|
5
|
-
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
|
|
6
5
|
import { isTypeSubTypeOf } from '../../utilities/typeComparators.mjs';
|
|
6
|
+
import { typeFromAST } from '../../utilities/typeFromAST.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Variables in allowed position
|
|
@@ -7,99 +7,99 @@ exports.specifiedSDLRules = exports.specifiedRules = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _ExecutableDefinitionsRule = require('./rules/ExecutableDefinitionsRule.js');
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _FieldsOnCorrectTypeRule = require('./rules/FieldsOnCorrectTypeRule.js');
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _FragmentsOnCompositeTypesRule = require('./rules/FragmentsOnCompositeTypesRule.js');
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _KnownArgumentNamesRule = require('./rules/KnownArgumentNamesRule.js');
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _KnownDirectivesRule = require('./rules/KnownDirectivesRule.js');
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _KnownFragmentNamesRule = require('./rules/KnownFragmentNamesRule.js');
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _KnownTypeNamesRule = require('./rules/KnownTypeNamesRule.js');
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _LoneAnonymousOperationRule = require('./rules/LoneAnonymousOperationRule.js');
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _LoneSchemaDefinitionRule = require('./rules/LoneSchemaDefinitionRule.js');
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _NoFragmentCyclesRule = require('./rules/NoFragmentCyclesRule.js');
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _NoUndefinedVariablesRule = require('./rules/NoUndefinedVariablesRule.js');
|
|
29
29
|
|
|
30
30
|
var _NoUnusedFragmentsRule = require('./rules/NoUnusedFragmentsRule.js');
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _NoUnusedVariablesRule = require('./rules/NoUnusedVariablesRule.js');
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _OverlappingFieldsCanBeMergedRule = require('./rules/OverlappingFieldsCanBeMergedRule.js');
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _PossibleFragmentSpreadsRule = require('./rules/PossibleFragmentSpreadsRule.js');
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _PossibleTypeExtensionsRule = require('./rules/PossibleTypeExtensionsRule.js');
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _ProvidedRequiredArgumentsRule = require('./rules/ProvidedRequiredArgumentsRule.js');
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _ScalarLeafsRule = require('./rules/ScalarLeafsRule.js');
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _SingleFieldSubscriptionsRule = require('./rules/SingleFieldSubscriptionsRule.js');
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _UniqueArgumentDefinitionNamesRule = require('./rules/UniqueArgumentDefinitionNamesRule.js');
|
|
47
47
|
|
|
48
48
|
var _UniqueArgumentNamesRule = require('./rules/UniqueArgumentNamesRule.js');
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _UniqueDirectiveNamesRule = require('./rules/UniqueDirectiveNamesRule.js');
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var _UniqueDirectivesPerLocationRule = require('./rules/UniqueDirectivesPerLocationRule.js');
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _UniqueEnumValueNamesRule = require('./rules/UniqueEnumValueNamesRule.js');
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var _UniqueFieldDefinitionNamesRule = require('./rules/UniqueFieldDefinitionNamesRule.js');
|
|
57
|
+
|
|
58
|
+
var _UniqueFragmentNamesRule = require('./rules/UniqueFragmentNamesRule.js');
|
|
57
59
|
|
|
58
60
|
var _UniqueInputFieldNamesRule = require('./rules/UniqueInputFieldNamesRule.js');
|
|
59
61
|
|
|
60
|
-
var
|
|
62
|
+
var _UniqueOperationNamesRule = require('./rules/UniqueOperationNamesRule.js');
|
|
61
63
|
|
|
62
64
|
var _UniqueOperationTypesRule = require('./rules/UniqueOperationTypesRule.js');
|
|
63
65
|
|
|
64
66
|
var _UniqueTypeNamesRule = require('./rules/UniqueTypeNamesRule.js');
|
|
65
67
|
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
var _UniqueFieldDefinitionNamesRule = require('./rules/UniqueFieldDefinitionNamesRule.js');
|
|
68
|
+
var _UniqueVariableNamesRule = require('./rules/UniqueVariableNamesRule.js');
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _ValuesOfCorrectTypeRule = require('./rules/ValuesOfCorrectTypeRule.js');
|
|
71
71
|
|
|
72
|
-
var
|
|
72
|
+
var _VariablesAreInputTypesRule = require('./rules/VariablesAreInputTypesRule.js');
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _VariablesInAllowedPositionRule = require('./rules/VariablesInAllowedPositionRule.js');
|
|
75
75
|
|
|
76
76
|
// Spec Section: "Executable Definitions"
|
|
77
|
-
// Spec Section: "Operation Name Uniqueness"
|
|
78
|
-
// Spec Section: "Lone Anonymous Operation"
|
|
79
|
-
// Spec Section: "Subscriptions with Single Root Field"
|
|
80
|
-
// Spec Section: "Fragment Spread Type Existence"
|
|
81
|
-
// Spec Section: "Fragments on Composite Types"
|
|
82
|
-
// Spec Section: "Variables are Input Types"
|
|
83
|
-
// Spec Section: "Leaf Field Selections"
|
|
84
77
|
// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
|
|
85
|
-
// Spec Section: "
|
|
78
|
+
// Spec Section: "Fragments on Composite Types"
|
|
79
|
+
// Spec Section: "Argument Names"
|
|
80
|
+
// Spec Section: "Directives Are Defined"
|
|
86
81
|
// Spec Section: "Fragment spread target defined"
|
|
87
|
-
// Spec Section: "
|
|
88
|
-
// Spec Section: "
|
|
82
|
+
// Spec Section: "Fragment Spread Type Existence"
|
|
83
|
+
// Spec Section: "Lone Anonymous Operation"
|
|
84
|
+
// SDL-specific validation rules
|
|
89
85
|
// Spec Section: "Fragments must not form cycles"
|
|
90
|
-
// Spec Section: "Variable Uniqueness"
|
|
91
86
|
// Spec Section: "All Variable Used Defined"
|
|
87
|
+
// Spec Section: "Fragments must be used"
|
|
92
88
|
// Spec Section: "All Variables Used"
|
|
93
|
-
// Spec Section: "
|
|
94
|
-
// Spec Section: "
|
|
95
|
-
// Spec Section: "Argument
|
|
89
|
+
// Spec Section: "Field Selection Merging"
|
|
90
|
+
// Spec Section: "Fragment spread is possible"
|
|
91
|
+
// Spec Section: "Argument Optionality"
|
|
92
|
+
// Spec Section: "Leaf Field Selections"
|
|
93
|
+
// Spec Section: "Subscriptions with Single Root Field"
|
|
96
94
|
// Spec Section: "Argument Uniqueness"
|
|
95
|
+
// Spec Section: "Directives Are Unique Per Location"
|
|
96
|
+
// Spec Section: "Fragment Name Uniqueness"
|
|
97
|
+
// Spec Section: "Input Object Field Uniqueness"
|
|
98
|
+
// Spec Section: "Operation Name Uniqueness"
|
|
99
|
+
// Spec Section: "Variable Uniqueness"
|
|
97
100
|
// Spec Section: "Value Type Correctness"
|
|
98
|
-
// Spec Section: "
|
|
101
|
+
// Spec Section: "Variables are Input Types"
|
|
99
102
|
// Spec Section: "All Variable Usages Are Allowed"
|
|
100
|
-
// Spec Section: "Field Selection Merging"
|
|
101
|
-
// Spec Section: "Input Object Field Uniqueness"
|
|
102
|
-
// SDL-specific validation rules
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* This set includes all validation rules defined by the GraphQL spec.
|