graphql 14.3.0 → 14.3.1
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.js +12 -10
- package/error/GraphQLError.js.flow +7 -1
- package/error/GraphQLError.mjs +12 -2
- package/error/formatError.js +1 -1
- package/error/formatError.mjs +1 -1
- package/error/index.js +1 -1
- package/error/index.mjs +1 -1
- package/error/locatedError.js +1 -1
- package/error/locatedError.mjs +1 -1
- package/error/printError.js +1 -1
- package/error/printError.mjs +1 -1
- package/error/syntaxError.js +1 -1
- package/error/syntaxError.mjs +1 -1
- package/execution/execute.js +32 -26
- package/execution/execute.js.flow +6 -3
- package/execution/execute.mjs +32 -26
- package/execution/index.js +1 -1
- package/execution/index.mjs +1 -1
- package/execution/values.js +4 -4
- package/execution/values.js.flow +4 -3
- package/execution/values.mjs +4 -4
- package/graphql.js +6 -2
- package/graphql.js.flow +2 -1
- package/graphql.mjs +3 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/jsutils/ObjMap.js +1 -1
- package/jsutils/ObjMap.mjs +1 -0
- package/jsutils/PromiseOrValue.js +1 -1
- package/jsutils/PromiseOrValue.mjs +1 -0
- package/jsutils/dedent.js +1 -1
- package/jsutils/dedent.mjs +1 -1
- package/jsutils/defineToJSON.js +1 -1
- package/jsutils/defineToJSON.mjs +1 -1
- package/jsutils/defineToStringTag.js +1 -1
- package/jsutils/defineToStringTag.mjs +1 -1
- package/jsutils/inspect.js +2 -2
- package/jsutils/inspect.js.flow +1 -1
- package/jsutils/inspect.mjs +2 -2
- package/jsutils/instanceOf.js +1 -1
- package/jsutils/instanceOf.mjs +1 -1
- package/jsutils/invariant.js +4 -2
- package/jsutils/invariant.js.flow +2 -1
- package/jsutils/invariant.mjs +4 -2
- package/jsutils/isInvalid.js +1 -1
- package/jsutils/isInvalid.mjs +1 -1
- package/jsutils/isNullish.js +1 -1
- package/jsutils/isNullish.mjs +1 -1
- package/jsutils/isPromise.js +1 -1
- package/jsutils/isPromise.mjs +1 -1
- package/jsutils/keyMap.js +3 -2
- package/jsutils/keyMap.js.flow +4 -4
- package/jsutils/keyMap.mjs +3 -2
- package/jsutils/keyValMap.js +3 -2
- package/jsutils/keyValMap.js.flow +4 -4
- package/jsutils/keyValMap.mjs +3 -2
- package/jsutils/mapValue.js +1 -1
- package/jsutils/mapValue.mjs +1 -1
- package/jsutils/memoize3.js +2 -2
- package/jsutils/memoize3.js.flow +1 -1
- package/jsutils/memoize3.mjs +2 -2
- package/jsutils/nodejsCustomInspectSymbol.js +1 -1
- package/jsutils/nodejsCustomInspectSymbol.mjs +1 -1
- package/jsutils/orList.js +1 -1
- package/jsutils/orList.mjs +1 -1
- package/jsutils/promiseForObject.js +1 -1
- package/jsutils/promiseForObject.mjs +1 -1
- package/jsutils/promiseReduce.js +1 -1
- package/jsutils/promiseReduce.mjs +1 -1
- package/jsutils/quotedOrList.js +1 -1
- package/jsutils/quotedOrList.mjs +1 -1
- package/jsutils/suggestionList.js +1 -1
- package/jsutils/suggestionList.mjs +1 -1
- package/language/ast.js +1 -1
- package/language/ast.mjs +1 -0
- package/language/blockString.js +1 -1
- package/language/blockString.js.flow +1 -1
- package/language/blockString.mjs +1 -1
- package/language/directiveLocation.js +1 -1
- package/language/directiveLocation.mjs +1 -1
- package/language/index.js +1 -1
- package/language/index.mjs +1 -1
- package/language/kinds.js +1 -1
- package/language/kinds.mjs +1 -1
- package/language/lexer.js +11 -9
- package/language/lexer.js.flow +3 -1
- package/language/lexer.mjs +11 -9
- package/language/location.js +1 -1
- package/language/location.mjs +1 -1
- package/language/parser.js +2 -2
- package/language/parser.js.flow +1 -1
- package/language/parser.mjs +2 -2
- package/language/predicates.js +1 -1
- package/language/predicates.mjs +1 -1
- package/language/printer.js +1 -1
- package/language/printer.mjs +1 -1
- package/language/source.js +1 -1
- package/language/source.mjs +1 -1
- package/language/visitor.js +1 -1
- package/language/visitor.mjs +1 -1
- package/package.json +1 -1
- package/polyfills/find.js +1 -1
- package/polyfills/find.mjs +1 -1
- package/polyfills/flatMap.js +1 -1
- package/polyfills/flatMap.mjs +1 -1
- package/polyfills/isFinite.js +1 -1
- package/polyfills/isFinite.mjs +1 -1
- package/polyfills/isInteger.js +1 -1
- package/polyfills/isInteger.mjs +1 -1
- package/polyfills/objectEntries.js +1 -1
- package/polyfills/objectEntries.mjs +1 -1
- package/polyfills/objectValues.js +1 -1
- package/polyfills/objectValues.mjs +1 -1
- package/subscription/asyncIteratorReject.js +1 -1
- package/subscription/asyncIteratorReject.mjs +1 -1
- package/subscription/index.js +1 -1
- package/subscription/index.mjs +1 -1
- package/subscription/mapAsyncIterator.js +1 -1
- package/subscription/mapAsyncIterator.mjs +1 -1
- package/subscription/subscribe.js +1 -1
- package/subscription/subscribe.mjs +1 -1
- package/type/definition.js +8 -14
- package/type/definition.js.flow +4 -4
- package/type/definition.mjs +8 -14
- package/type/directives.js +1 -1
- package/type/directives.mjs +1 -1
- package/type/index.js +1 -1
- package/type/index.mjs +1 -1
- package/type/introspection.js +1 -1
- package/type/introspection.mjs +1 -1
- package/type/scalars.js +1 -1
- package/type/scalars.mjs +1 -1
- package/type/schema.js +3 -2
- package/type/schema.js.flow +4 -4
- package/type/schema.mjs +3 -2
- package/type/validate.js +1 -1
- package/type/validate.mjs +1 -1
- package/utilities/TypeInfo.js +92 -72
- package/utilities/TypeInfo.js.flow +18 -9
- package/utilities/TypeInfo.mjs +92 -72
- package/utilities/assertValidName.js +1 -1
- package/utilities/assertValidName.mjs +1 -1
- package/utilities/astFromValue.js +1 -1
- package/utilities/astFromValue.mjs +1 -1
- package/utilities/buildASTSchema.js +3 -1
- package/utilities/buildASTSchema.mjs +3 -1
- package/utilities/buildClientSchema.js +5 -2
- package/utilities/buildClientSchema.js.flow +3 -1
- package/utilities/buildClientSchema.mjs +5 -2
- package/utilities/coerceValue.js +1 -1
- package/utilities/coerceValue.mjs +1 -1
- package/utilities/concatAST.js +1 -1
- package/utilities/concatAST.mjs +1 -1
- package/utilities/extendSchema.js +1 -1
- package/utilities/extendSchema.mjs +1 -1
- package/utilities/findBreakingChanges.js +23 -34
- package/utilities/findBreakingChanges.js.flow +40 -34
- package/utilities/findBreakingChanges.mjs +49 -34
- package/utilities/findDeprecatedUsages.js +1 -1
- package/utilities/findDeprecatedUsages.mjs +1 -1
- package/utilities/getOperationAST.js +1 -1
- package/utilities/getOperationAST.mjs +1 -1
- package/utilities/getOperationRootType.js +23 -23
- package/utilities/getOperationRootType.js.flow +33 -30
- package/utilities/getOperationRootType.mjs +23 -23
- package/utilities/index.js +1 -1
- package/utilities/index.mjs +1 -1
- package/utilities/introspectionFromSchema.js +4 -2
- package/utilities/introspectionFromSchema.js.flow +2 -1
- package/utilities/introspectionFromSchema.mjs +3 -2
- package/utilities/introspectionQuery.js +1 -1
- package/utilities/introspectionQuery.mjs +1 -1
- package/utilities/isValidJSValue.js +1 -1
- package/utilities/isValidJSValue.mjs +1 -1
- package/utilities/isValidLiteralValue.js +1 -1
- package/utilities/isValidLiteralValue.mjs +1 -1
- package/utilities/lexicographicSortSchema.js +1 -1
- package/utilities/lexicographicSortSchema.mjs +1 -1
- package/utilities/schemaPrinter.js +1 -1
- package/utilities/schemaPrinter.mjs +1 -1
- package/utilities/separateOperations.js +1 -1
- package/utilities/separateOperations.mjs +1 -1
- package/utilities/stripIgnoredCharacters.js +7 -7
- package/utilities/stripIgnoredCharacters.js.flow +6 -6
- package/utilities/stripIgnoredCharacters.mjs +7 -7
- package/utilities/typeComparators.js +1 -1
- package/utilities/typeComparators.mjs +1 -1
- package/utilities/typeFromAST.js +1 -1
- package/utilities/typeFromAST.mjs +1 -1
- package/utilities/valueFromAST.js +1 -1
- package/utilities/valueFromAST.mjs +1 -1
- package/utilities/valueFromASTUntyped.js +5 -3
- package/utilities/valueFromASTUntyped.js.flow +2 -1
- package/utilities/valueFromASTUntyped.mjs +5 -3
- package/validation/ValidationContext.js +1 -1
- package/validation/ValidationContext.mjs +1 -1
- package/validation/index.js +1 -1
- package/validation/index.mjs +1 -1
- package/validation/rules/ExecutableDefinitions.js +1 -1
- package/validation/rules/ExecutableDefinitions.mjs +1 -1
- package/validation/rules/FieldsOnCorrectType.js +1 -1
- package/validation/rules/FieldsOnCorrectType.mjs +1 -1
- package/validation/rules/FragmentsOnCompositeTypes.js +1 -1
- package/validation/rules/FragmentsOnCompositeTypes.mjs +1 -1
- package/validation/rules/KnownArgumentNames.js +1 -1
- package/validation/rules/KnownArgumentNames.mjs +1 -1
- package/validation/rules/KnownDirectives.js +5 -3
- package/validation/rules/KnownDirectives.js.flow +2 -1
- package/validation/rules/KnownDirectives.mjs +5 -3
- package/validation/rules/KnownFragmentNames.js +1 -1
- package/validation/rules/KnownFragmentNames.mjs +1 -1
- package/validation/rules/KnownTypeNames.js +1 -1
- package/validation/rules/KnownTypeNames.mjs +1 -1
- package/validation/rules/LoneAnonymousOperation.js +1 -1
- package/validation/rules/LoneAnonymousOperation.mjs +1 -1
- package/validation/rules/LoneSchemaDefinition.js +1 -1
- package/validation/rules/LoneSchemaDefinition.mjs +1 -1
- package/validation/rules/NoFragmentCycles.js +1 -1
- package/validation/rules/NoFragmentCycles.mjs +1 -1
- package/validation/rules/NoUndefinedVariables.js +1 -1
- package/validation/rules/NoUndefinedVariables.mjs +1 -1
- package/validation/rules/NoUnusedFragments.js +1 -1
- package/validation/rules/NoUnusedFragments.mjs +1 -1
- package/validation/rules/NoUnusedVariables.js +1 -1
- package/validation/rules/NoUnusedVariables.mjs +1 -1
- package/validation/rules/OverlappingFieldsCanBeMerged.js +21 -16
- package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +4 -2
- package/validation/rules/OverlappingFieldsCanBeMerged.mjs +21 -16
- package/validation/rules/PossibleFragmentSpreads.js +1 -1
- package/validation/rules/PossibleFragmentSpreads.mjs +1 -1
- package/validation/rules/PossibleTypeExtensions.js +1 -1
- package/validation/rules/PossibleTypeExtensions.mjs +1 -1
- package/validation/rules/ProvidedRequiredArguments.js +1 -1
- package/validation/rules/ProvidedRequiredArguments.mjs +1 -1
- package/validation/rules/ScalarLeafs.js +1 -1
- package/validation/rules/ScalarLeafs.mjs +1 -1
- package/validation/rules/SingleFieldSubscriptions.js +1 -1
- package/validation/rules/SingleFieldSubscriptions.mjs +1 -1
- package/validation/rules/UniqueArgumentNames.js +1 -1
- package/validation/rules/UniqueArgumentNames.mjs +1 -1
- package/validation/rules/UniqueDirectiveNames.js +1 -1
- package/validation/rules/UniqueDirectiveNames.mjs +1 -1
- package/validation/rules/UniqueDirectivesPerLocation.js +2 -1
- package/validation/rules/UniqueDirectivesPerLocation.mjs +2 -1
- package/validation/rules/UniqueEnumValueNames.js +1 -1
- package/validation/rules/UniqueEnumValueNames.mjs +1 -1
- package/validation/rules/UniqueFieldDefinitionNames.js +1 -1
- package/validation/rules/UniqueFieldDefinitionNames.mjs +1 -1
- package/validation/rules/UniqueFragmentNames.js +1 -1
- package/validation/rules/UniqueFragmentNames.mjs +1 -1
- package/validation/rules/UniqueInputFieldNames.js +1 -1
- package/validation/rules/UniqueInputFieldNames.mjs +1 -1
- package/validation/rules/UniqueOperationNames.js +1 -1
- package/validation/rules/UniqueOperationNames.mjs +1 -1
- package/validation/rules/UniqueOperationTypes.js +1 -1
- package/validation/rules/UniqueOperationTypes.mjs +1 -1
- package/validation/rules/UniqueTypeNames.js +1 -1
- package/validation/rules/UniqueTypeNames.mjs +1 -1
- package/validation/rules/UniqueVariableNames.js +1 -1
- package/validation/rules/UniqueVariableNames.mjs +1 -1
- package/validation/rules/ValuesOfCorrectType.js +1 -1
- package/validation/rules/ValuesOfCorrectType.mjs +1 -1
- package/validation/rules/VariablesAreInputTypes.js +1 -1
- package/validation/rules/VariablesAreInputTypes.mjs +1 -1
- package/validation/rules/VariablesInAllowedPosition.js +2 -2
- package/validation/rules/VariablesInAllowedPosition.js.flow +1 -1
- package/validation/rules/VariablesInAllowedPosition.mjs +2 -2
- package/validation/specifiedRules.js +1 -1
- package/validation/specifiedRules.mjs +1 -1
- package/validation/validate.js +1 -1
- package/validation/validate.mjs +1 -1
- package/codecov.yml +0 -14
|
@@ -302,6 +302,7 @@ function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames
|
|
|
302
302
|
// A field map is a keyed collection, where each key represents a response
|
|
303
303
|
// name and the value at that key is a list of all fields which provide that
|
|
304
304
|
// response name. For every response name, if there are multiple fields, they
|
|
305
|
+
// must be compared to find a potential conflict.
|
|
305
306
|
var _iteratorNormalCompletion = true;
|
|
306
307
|
var _didIteratorError = false;
|
|
307
308
|
var _iteratorError = undefined;
|
|
@@ -516,33 +517,37 @@ function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeA
|
|
|
516
517
|
|
|
517
518
|
switch (selection.kind) {
|
|
518
519
|
case _kinds.Kind.FIELD:
|
|
519
|
-
|
|
520
|
-
|
|
520
|
+
{
|
|
521
|
+
var fieldName = selection.name.value;
|
|
522
|
+
var fieldDef = void 0;
|
|
521
523
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
524
|
+
if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
|
|
525
|
+
fieldDef = parentType.getFields()[fieldName];
|
|
526
|
+
}
|
|
525
527
|
|
|
526
|
-
|
|
528
|
+
var responseName = selection.alias ? selection.alias.value : fieldName;
|
|
527
529
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
530
|
+
if (!nodeAndDefs[responseName]) {
|
|
531
|
+
nodeAndDefs[responseName] = [];
|
|
532
|
+
}
|
|
531
533
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
+
nodeAndDefs[responseName].push([parentType, selection, fieldDef]);
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
534
537
|
|
|
535
538
|
case _kinds.Kind.FRAGMENT_SPREAD:
|
|
536
539
|
fragmentNames[selection.name.value] = true;
|
|
537
540
|
break;
|
|
538
541
|
|
|
539
542
|
case _kinds.Kind.INLINE_FRAGMENT:
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
{
|
|
544
|
+
var typeCondition = selection.typeCondition;
|
|
545
|
+
var inlineFragmentType = typeCondition ? (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition) : parentType;
|
|
542
546
|
|
|
543
|
-
|
|
547
|
+
_collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames);
|
|
544
548
|
|
|
545
|
-
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
546
551
|
}
|
|
547
552
|
}
|
|
548
553
|
} // Given a series of Conflicts which occurred between two sub-fields, generate
|
|
@@ -614,4 +619,4 @@ function _pairSetAdd(data, a, b, areMutuallyExclusive) {
|
|
|
614
619
|
}
|
|
615
620
|
|
|
616
621
|
map[b] = areMutuallyExclusive;
|
|
617
|
-
}
|
|
622
|
+
}
|
|
@@ -747,7 +747,7 @@ function _collectFieldsAndFragmentNames(
|
|
|
747
747
|
for (let i = 0; i < selectionSet.selections.length; i++) {
|
|
748
748
|
const selection = selectionSet.selections[i];
|
|
749
749
|
switch (selection.kind) {
|
|
750
|
-
case Kind.FIELD:
|
|
750
|
+
case Kind.FIELD: {
|
|
751
751
|
const fieldName = selection.name.value;
|
|
752
752
|
let fieldDef;
|
|
753
753
|
if (isObjectType(parentType) || isInterfaceType(parentType)) {
|
|
@@ -761,10 +761,11 @@ function _collectFieldsAndFragmentNames(
|
|
|
761
761
|
}
|
|
762
762
|
nodeAndDefs[responseName].push([parentType, selection, fieldDef]);
|
|
763
763
|
break;
|
|
764
|
+
}
|
|
764
765
|
case Kind.FRAGMENT_SPREAD:
|
|
765
766
|
fragmentNames[selection.name.value] = true;
|
|
766
767
|
break;
|
|
767
|
-
case Kind.INLINE_FRAGMENT:
|
|
768
|
+
case Kind.INLINE_FRAGMENT: {
|
|
768
769
|
const typeCondition = selection.typeCondition;
|
|
769
770
|
const inlineFragmentType = typeCondition
|
|
770
771
|
? typeFromAST(context.getSchema(), typeCondition)
|
|
@@ -777,6 +778,7 @@ function _collectFieldsAndFragmentNames(
|
|
|
777
778
|
fragmentNames,
|
|
778
779
|
);
|
|
779
780
|
break;
|
|
781
|
+
}
|
|
780
782
|
}
|
|
781
783
|
}
|
|
782
784
|
}
|
|
@@ -284,6 +284,7 @@ function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames
|
|
|
284
284
|
// A field map is a keyed collection, where each key represents a response
|
|
285
285
|
// name and the value at that key is a list of all fields which provide that
|
|
286
286
|
// response name. For every response name, if there are multiple fields, they
|
|
287
|
+
// must be compared to find a potential conflict.
|
|
287
288
|
var _iteratorNormalCompletion = true;
|
|
288
289
|
var _didIteratorError = false;
|
|
289
290
|
var _iteratorError = undefined;
|
|
@@ -498,33 +499,37 @@ function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeA
|
|
|
498
499
|
|
|
499
500
|
switch (selection.kind) {
|
|
500
501
|
case Kind.FIELD:
|
|
501
|
-
|
|
502
|
-
|
|
502
|
+
{
|
|
503
|
+
var fieldName = selection.name.value;
|
|
504
|
+
var fieldDef = void 0;
|
|
503
505
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
506
|
+
if (isObjectType(parentType) || isInterfaceType(parentType)) {
|
|
507
|
+
fieldDef = parentType.getFields()[fieldName];
|
|
508
|
+
}
|
|
507
509
|
|
|
508
|
-
|
|
510
|
+
var responseName = selection.alias ? selection.alias.value : fieldName;
|
|
509
511
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
512
|
+
if (!nodeAndDefs[responseName]) {
|
|
513
|
+
nodeAndDefs[responseName] = [];
|
|
514
|
+
}
|
|
513
515
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
+
nodeAndDefs[responseName].push([parentType, selection, fieldDef]);
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
516
519
|
|
|
517
520
|
case Kind.FRAGMENT_SPREAD:
|
|
518
521
|
fragmentNames[selection.name.value] = true;
|
|
519
522
|
break;
|
|
520
523
|
|
|
521
524
|
case Kind.INLINE_FRAGMENT:
|
|
522
|
-
|
|
523
|
-
|
|
525
|
+
{
|
|
526
|
+
var typeCondition = selection.typeCondition;
|
|
527
|
+
var inlineFragmentType = typeCondition ? typeFromAST(context.getSchema(), typeCondition) : parentType;
|
|
524
528
|
|
|
525
|
-
|
|
529
|
+
_collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames);
|
|
526
530
|
|
|
527
|
-
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
528
533
|
}
|
|
529
534
|
}
|
|
530
535
|
} // Given a series of Conflicts which occurred between two sub-fields, generate
|
|
@@ -596,4 +601,4 @@ function _pairSetAdd(data, a, b, areMutuallyExclusive) {
|
|
|
596
601
|
}
|
|
597
602
|
|
|
598
603
|
map[b] = areMutuallyExclusive;
|
|
599
|
-
}
|
|
604
|
+
}
|
|
@@ -34,6 +34,7 @@ function UniqueDirectivesPerLocation(context) {
|
|
|
34
34
|
// defines any directives.
|
|
35
35
|
enter: function enter(node) {
|
|
36
36
|
// Flow can't refine that node.directives will only contain directives,
|
|
37
|
+
// so we cast so the rest of the code is well typed.
|
|
37
38
|
var directives = node.directives;
|
|
38
39
|
|
|
39
40
|
if (directives) {
|
|
@@ -70,4 +71,4 @@ function UniqueDirectivesPerLocation(context) {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
}
|
|
74
|
+
}
|
|
@@ -24,6 +24,7 @@ export function UniqueDirectivesPerLocation(context) {
|
|
|
24
24
|
// defines any directives.
|
|
25
25
|
enter: function enter(node) {
|
|
26
26
|
// Flow can't refine that node.directives will only contain directives,
|
|
27
|
+
// so we cast so the rest of the code is well typed.
|
|
27
28
|
var directives = node.directives;
|
|
28
29
|
|
|
29
30
|
if (directives) {
|
|
@@ -60,4 +61,4 @@ export function UniqueDirectivesPerLocation(context) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
}
|
|
64
|
+
}
|
|
@@ -102,7 +102,7 @@ function VariablesInAllowedPosition(context) {
|
|
|
102
102
|
|
|
103
103
|
function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {
|
|
104
104
|
if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) {
|
|
105
|
-
var hasNonNullVariableDefaultValue = varDefaultValue && varDefaultValue.kind !== _kinds.Kind.NULL;
|
|
105
|
+
var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL;
|
|
106
106
|
var hasLocationDefaultValue = locationDefaultValue !== undefined;
|
|
107
107
|
|
|
108
108
|
if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {
|
|
@@ -114,4 +114,4 @@ function allowedVariableUsage(schema, varType, varDefaultValue, locationType, lo
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType);
|
|
117
|
-
}
|
|
117
|
+
}
|
|
@@ -97,7 +97,7 @@ function allowedVariableUsage(
|
|
|
97
97
|
): boolean {
|
|
98
98
|
if (isNonNullType(locationType) && !isNonNullType(varType)) {
|
|
99
99
|
const hasNonNullVariableDefaultValue =
|
|
100
|
-
varDefaultValue && varDefaultValue.kind !== Kind.NULL;
|
|
100
|
+
varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;
|
|
101
101
|
const hasLocationDefaultValue = locationDefaultValue !== undefined;
|
|
102
102
|
if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {
|
|
103
103
|
return false;
|
|
@@ -84,7 +84,7 @@ export function VariablesInAllowedPosition(context) {
|
|
|
84
84
|
|
|
85
85
|
function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {
|
|
86
86
|
if (isNonNullType(locationType) && !isNonNullType(varType)) {
|
|
87
|
-
var hasNonNullVariableDefaultValue = varDefaultValue && varDefaultValue.kind !== Kind.NULL;
|
|
87
|
+
var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;
|
|
88
88
|
var hasLocationDefaultValue = locationDefaultValue !== undefined;
|
|
89
89
|
|
|
90
90
|
if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {
|
|
@@ -96,4 +96,4 @@ function allowedVariableUsage(schema, varType, varDefaultValue, locationType, lo
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
return isTypeSubTypeOf(schema, varType, locationType);
|
|
99
|
-
}
|
|
99
|
+
}
|
|
@@ -116,4 +116,4 @@ var specifiedRules = [_ExecutableDefinitions.ExecutableDefinitions, _UniqueOpera
|
|
|
116
116
|
exports.specifiedRules = specifiedRules;
|
|
117
117
|
// @internal
|
|
118
118
|
var specifiedSDLRules = [_LoneSchemaDefinition.LoneSchemaDefinition, _UniqueOperationTypes.UniqueOperationTypes, _UniqueTypeNames.UniqueTypeNames, _UniqueEnumValueNames.UniqueEnumValueNames, _UniqueFieldDefinitionNames.UniqueFieldDefinitionNames, _UniqueDirectiveNames.UniqueDirectiveNames, _KnownTypeNames.KnownTypeNames, _KnownDirectives.KnownDirectives, _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation, _PossibleTypeExtensions.PossibleTypeExtensions, _KnownArgumentNames.KnownArgumentNamesOnDirectives, _UniqueArgumentNames.UniqueArgumentNames, _UniqueInputFieldNames.UniqueInputFieldNames, _ProvidedRequiredArguments.ProvidedRequiredArgumentsOnDirectives];
|
|
119
|
-
exports.specifiedSDLRules = specifiedSDLRules;
|
|
119
|
+
exports.specifiedSDLRules = specifiedSDLRules;
|
|
@@ -76,4 +76,4 @@ import { UniqueFieldDefinitionNames } from './rules/UniqueFieldDefinitionNames';
|
|
|
76
76
|
import { UniqueDirectiveNames } from './rules/UniqueDirectiveNames';
|
|
77
77
|
import { PossibleTypeExtensions } from './rules/PossibleTypeExtensions'; // @internal
|
|
78
78
|
|
|
79
|
-
export var specifiedSDLRules = [LoneSchemaDefinition, UniqueOperationTypes, UniqueTypeNames, UniqueEnumValueNames, UniqueFieldDefinitionNames, UniqueDirectiveNames, KnownTypeNames, KnownDirectives, UniqueDirectivesPerLocation, PossibleTypeExtensions, KnownArgumentNamesOnDirectives, UniqueArgumentNames, UniqueInputFieldNames, ProvidedRequiredArgumentsOnDirectives];
|
|
79
|
+
export var specifiedSDLRules = [LoneSchemaDefinition, UniqueOperationTypes, UniqueTypeNames, UniqueEnumValueNames, UniqueFieldDefinitionNames, UniqueDirectiveNames, KnownTypeNames, KnownDirectives, UniqueDirectivesPerLocation, PossibleTypeExtensions, KnownArgumentNamesOnDirectives, UniqueArgumentNames, UniqueInputFieldNames, ProvidedRequiredArgumentsOnDirectives];
|
package/validation/validate.js
CHANGED
package/validation/validate.mjs
CHANGED