graphql 14.4.2 → 14.5.3
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 -10
- package/error/GraphQLError.d.ts +87 -0
- package/error/GraphQLError.js +7 -45
- package/error/GraphQLError.js.flow +1 -0
- package/error/GraphQLError.mjs +7 -45
- package/error/formatError.d.ts +39 -0
- package/error/formatError.js +5 -2
- package/error/formatError.js.flow +27 -3
- package/error/formatError.mjs +5 -2
- package/error/index.d.ts +4 -0
- package/error/locatedError.d.ts +13 -0
- package/error/locatedError.js.flow +2 -1
- package/error/locatedError.mjs +1 -1
- package/error/syntaxError.d.ts +12 -0
- package/error/syntaxError.js.flow +1 -0
- package/execution/execute.d.ts +190 -0
- package/execution/execute.js +55 -89
- package/execution/execute.js.flow +95 -133
- package/execution/execute.mjs +75 -80
- package/execution/index.d.ts +11 -0
- package/execution/index.js +8 -6
- package/execution/index.js.flow +3 -6
- package/execution/index.mjs +2 -1
- package/execution/values.d.ts +68 -0
- package/execution/values.js +119 -128
- package/execution/values.js.flow +150 -127
- package/execution/values.mjs +117 -125
- package/graphql.d.ts +88 -0
- package/graphql.js +5 -5
- package/graphql.js.flow +9 -5
- package/graphql.mjs +41 -1
- package/index.d.ts +446 -0
- package/index.js +6 -0
- package/index.js.flow +3 -1
- package/index.mjs +2 -1
- package/jsutils/ObjMap.js.flow +6 -0
- package/jsutils/Path.d.ts +14 -0
- package/jsutils/Path.js +33 -0
- package/jsutils/Path.js.flow +26 -0
- package/jsutils/Path.mjs +24 -0
- package/jsutils/PromiseOrValue.d.ts +1 -0
- package/jsutils/dedent.js +6 -24
- package/jsutils/dedent.mjs +6 -24
- package/jsutils/defineToStringTag.js.flow +1 -1
- package/jsutils/devAssert.js +14 -0
- package/jsutils/devAssert.js.flow +8 -0
- package/jsutils/devAssert.mjs +7 -0
- package/jsutils/inspect.js +1 -1
- package/jsutils/inspect.js.flow +1 -1
- package/jsutils/inspect.mjs +1 -1
- package/jsutils/invariant.js +1 -2
- package/jsutils/invariant.js.flow +2 -3
- package/jsutils/invariant.mjs +1 -2
- package/jsutils/mapValue.js +6 -24
- package/jsutils/mapValue.js.flow +2 -1
- package/jsutils/mapValue.mjs +6 -24
- package/jsutils/printPathArray.js +15 -0
- package/jsutils/printPathArray.js.flow +14 -0
- package/jsutils/printPathArray.mjs +8 -0
- package/jsutils/suggestionList.js +14 -34
- package/jsutils/suggestionList.js.flow +4 -6
- package/jsutils/suggestionList.mjs +14 -34
- package/jsutils/toObjMap.js +28 -0
- package/jsutils/toObjMap.js.flow +26 -0
- package/jsutils/toObjMap.mjs +18 -0
- package/language/ast.d.ts +573 -0
- package/language/blockString.d.ts +21 -0
- package/language/directiveLocation.d.ts +35 -0
- package/language/index.d.ts +96 -0
- package/language/kinds.d.ts +77 -0
- package/language/lexer.d.ts +60 -0
- package/language/lexer.js +2 -12
- package/language/lexer.js.flow +6 -12
- package/language/lexer.mjs +1 -9
- package/language/location.d.ts +15 -0
- package/language/parser.d.ts +89 -0
- package/language/parser.js +1329 -1302
- package/language/parser.js.flow +1289 -1298
- package/language/parser.mjs +1326 -1297
- package/language/predicates.d.ts +36 -0
- package/language/predicates.js.flow +1 -1
- package/language/printLocation.d.ts +16 -0
- package/language/printLocation.js.flow +1 -1
- package/language/printer.d.ts +7 -0
- package/language/printer.js.flow +1 -1
- package/language/source.d.ts +19 -0
- package/language/source.js +3 -3
- package/language/source.js.flow +3 -3
- package/language/source.mjs +3 -3
- package/language/tokenKind.d.ts +35 -0
- package/language/visitor.d.ts +264 -0
- package/language/visitor.js +2 -2
- package/language/visitor.js.flow +3 -1
- package/language/visitor.mjs +2 -2
- package/package.json +1 -1
- package/polyfills/find.js +2 -2
- package/polyfills/find.js.flow +1 -2
- package/polyfills/find.mjs +2 -2
- package/polyfills/flatMap.js +3 -3
- package/polyfills/flatMap.js.flow +2 -3
- package/polyfills/flatMap.mjs +3 -3
- package/subscription/asyncIteratorReject.d.ts +6 -0
- package/subscription/index.d.ts +5 -0
- package/subscription/mapAsyncIterator.d.ts +9 -0
- package/subscription/mapAsyncIterator.js.flow +1 -0
- package/subscription/subscribe.d.ts +86 -0
- package/subscription/subscribe.js +29 -10
- package/subscription/subscribe.js.flow +45 -24
- package/subscription/subscribe.mjs +27 -9
- package/tsutils/Maybe.d.ts +4 -0
- package/type/definition.d.ts +805 -0
- package/type/definition.js +154 -70
- package/type/definition.js.flow +217 -160
- package/type/definition.mjs +149 -66
- package/type/directives.d.ts +72 -0
- package/type/directives.js +20 -12
- package/type/directives.js.flow +34 -19
- package/type/directives.mjs +17 -10
- package/type/index.d.ts +155 -0
- package/type/index.js.flow +2 -2
- package/type/introspection.d.ts +40 -0
- package/type/introspection.js +24 -10
- package/type/introspection.js.flow +29 -8
- package/type/introspection.mjs +23 -10
- package/type/scalars.d.ts +11 -0
- package/type/scalars.js +2 -2
- package/type/scalars.js.flow +4 -1
- package/type/scalars.mjs +2 -2
- package/type/schema.d.ts +108 -0
- package/type/schema.js +74 -151
- package/type/schema.js.flow +75 -73
- package/type/schema.mjs +75 -149
- package/type/validate.d.ts +19 -0
- package/type/validate.js +227 -486
- package/type/validate.js.flow +13 -8
- package/type/validate.mjs +218 -477
- package/utilities/TypeInfo.d.ts +49 -0
- package/utilities/TypeInfo.js.flow +9 -6
- package/utilities/assertValidName.d.ts +15 -0
- package/utilities/assertValidName.js +3 -3
- package/utilities/assertValidName.js.flow +3 -2
- package/utilities/assertValidName.mjs +2 -2
- package/utilities/astFromValue.d.ts +25 -0
- package/utilities/astFromValue.js +22 -38
- package/utilities/astFromValue.js.flow +7 -4
- package/utilities/astFromValue.mjs +19 -36
- package/utilities/buildASTSchema.d.ts +114 -0
- package/utilities/buildASTSchema.js +37 -68
- package/utilities/buildASTSchema.js.flow +32 -30
- package/utilities/buildASTSchema.mjs +32 -64
- package/utilities/buildClientSchema.d.ts +21 -0
- package/utilities/buildClientSchema.js +23 -15
- package/utilities/buildClientSchema.js.flow +17 -16
- package/utilities/buildClientSchema.mjs +20 -12
- package/utilities/coerceInputValue.d.ts +17 -0
- package/utilities/coerceInputValue.js +161 -0
- package/utilities/coerceInputValue.js.flow +214 -0
- package/utilities/coerceInputValue.mjs +142 -0
- package/utilities/coerceValue.d.ts +23 -0
- package/utilities/coerceValue.js +21 -199
- package/utilities/coerceValue.js.flow +31 -223
- package/utilities/coerceValue.mjs +20 -195
- package/utilities/concatAST.d.ts +8 -0
- package/utilities/concatAST.js.flow +1 -0
- package/utilities/extendSchema.d.ts +45 -0
- package/utilities/extendSchema.js +64 -131
- package/utilities/extendSchema.js.flow +27 -24
- package/utilities/extendSchema.mjs +61 -129
- package/utilities/findBreakingChanges.d.ts +64 -0
- package/utilities/findBreakingChanges.js +194 -619
- package/utilities/findBreakingChanges.js.flow +8 -5
- package/utilities/findBreakingChanges.mjs +194 -619
- package/utilities/findDeprecatedUsages.d.ts +13 -0
- package/utilities/findDeprecatedUsages.js.flow +4 -1
- package/utilities/getOperationAST.d.ts +12 -0
- package/utilities/getOperationAST.js +13 -31
- package/utilities/getOperationAST.mjs +13 -31
- package/utilities/getOperationRootType.d.ts +14 -0
- package/utilities/getOperationRootType.js.flow +2 -0
- package/utilities/index.d.ts +127 -0
- package/utilities/index.js +8 -0
- package/utilities/index.js.flow +4 -1
- package/utilities/index.mjs +3 -1
- package/utilities/introspectionFromSchema.d.ts +16 -0
- package/utilities/introspectionFromSchema.js +5 -3
- package/utilities/introspectionFromSchema.js.flow +4 -2
- package/utilities/introspectionFromSchema.mjs +4 -2
- package/utilities/introspectionQuery.d.ts +177 -0
- package/utilities/isValidJSValue.d.ts +8 -0
- package/utilities/isValidJSValue.js +1 -1
- package/utilities/isValidJSValue.js.flow +3 -2
- package/utilities/isValidJSValue.mjs +2 -2
- package/utilities/isValidLiteralValue.d.ts +15 -0
- package/utilities/isValidLiteralValue.js +4 -4
- package/utilities/isValidLiteralValue.js.flow +8 -4
- package/utilities/isValidLiteralValue.mjs +2 -2
- package/utilities/lexicographicSortSchema.d.ts +6 -0
- package/utilities/lexicographicSortSchema.js +11 -8
- package/utilities/lexicographicSortSchema.js.flow +5 -3
- package/utilities/lexicographicSortSchema.mjs +9 -7
- package/utilities/schemaPrinter.d.ts +30 -0
- package/utilities/schemaPrinter.js +15 -32
- package/utilities/schemaPrinter.js.flow +14 -10
- package/utilities/schemaPrinter.mjs +14 -32
- package/utilities/separateOperations.d.ts +11 -0
- package/utilities/separateOperations.js +6 -6
- package/utilities/separateOperations.js.flow +2 -1
- package/utilities/separateOperations.mjs +6 -6
- package/utilities/stripIgnoredCharacters.d.ts +55 -0
- package/utilities/stripIgnoredCharacters.js.flow +1 -0
- package/utilities/typeComparators.d.ts +32 -0
- package/utilities/typeComparators.js.flow +1 -1
- package/utilities/typeComparators.mjs +1 -1
- package/utilities/typeFromAST.d.ts +29 -0
- package/utilities/typeFromAST.js +5 -3
- package/utilities/typeFromAST.js.flow +5 -3
- package/utilities/typeFromAST.mjs +14 -3
- package/utilities/valueFromAST.d.ts +29 -0
- package/utilities/valueFromAST.js +40 -74
- package/utilities/valueFromAST.js.flow +7 -4
- package/utilities/valueFromAST.mjs +39 -74
- package/utilities/valueFromASTUntyped.d.ts +23 -0
- package/utilities/valueFromASTUntyped.js +4 -3
- package/utilities/valueFromASTUntyped.js.flow +3 -2
- package/utilities/valueFromASTUntyped.mjs +3 -3
- package/validation/ValidationContext.d.ts +96 -0
- package/validation/ValidationContext.js +38 -86
- package/validation/ValidationContext.js.flow +22 -7
- package/validation/ValidationContext.mjs +37 -85
- package/validation/index.d.ts +126 -0
- package/validation/rules/ExecutableDefinitions.d.ts +14 -0
- package/validation/rules/ExecutableDefinitions.js +4 -23
- package/validation/rules/ExecutableDefinitions.js.flow +4 -2
- package/validation/rules/ExecutableDefinitions.mjs +4 -23
- package/validation/rules/FieldsOnCorrectType.d.ts +17 -0
- package/validation/rules/FieldsOnCorrectType.js +21 -57
- package/validation/rules/FieldsOnCorrectType.js.flow +7 -3
- package/validation/rules/FieldsOnCorrectType.mjs +21 -57
- package/validation/rules/FragmentsOnCompositeTypes.d.ts +20 -0
- package/validation/rules/FragmentsOnCompositeTypes.js.flow +5 -1
- package/validation/rules/KnownArgumentNames.d.ts +28 -0
- package/validation/rules/KnownArgumentNames.js +26 -79
- package/validation/rules/KnownArgumentNames.js.flow +10 -6
- package/validation/rules/KnownArgumentNames.mjs +22 -75
- package/validation/rules/KnownDirectives.d.ts +19 -0
- package/validation/rules/KnownDirectives.js +12 -48
- package/validation/rules/KnownDirectives.js.flow +8 -5
- package/validation/rules/KnownDirectives.mjs +12 -48
- package/validation/rules/KnownFragmentNames.d.ts +12 -0
- package/validation/rules/KnownFragmentNames.js.flow +2 -1
- package/validation/rules/KnownTypeNames.d.ts +15 -0
- package/validation/rules/KnownTypeNames.js +6 -24
- package/validation/rules/KnownTypeNames.js.flow +10 -6
- package/validation/rules/KnownTypeNames.mjs +6 -24
- package/validation/rules/LoneAnonymousOperation.d.ts +14 -0
- package/validation/rules/LoneAnonymousOperation.js.flow +3 -1
- package/validation/rules/LoneSchemaDefinition.d.ts +13 -0
- package/validation/rules/LoneSchemaDefinition.js.flow +2 -1
- package/validation/rules/NoFragmentCycles.d.ts +9 -0
- package/validation/rules/NoFragmentCycles.js +17 -35
- package/validation/rules/NoFragmentCycles.js.flow +4 -2
- package/validation/rules/NoFragmentCycles.mjs +17 -35
- package/validation/rules/NoUndefinedVariables.d.ts +16 -0
- package/validation/rules/NoUndefinedVariables.js +6 -24
- package/validation/rules/NoUndefinedVariables.js.flow +2 -1
- package/validation/rules/NoUndefinedVariables.mjs +6 -24
- package/validation/rules/NoUnusedFragments.d.ts +12 -0
- package/validation/rules/NoUnusedFragments.js +7 -25
- package/validation/rules/NoUnusedFragments.js.flow +2 -1
- package/validation/rules/NoUnusedFragments.mjs +7 -25
- package/validation/rules/NoUnusedVariables.d.ts +16 -0
- package/validation/rules/NoUnusedVariables.js +6 -24
- package/validation/rules/NoUnusedVariables.js.flow +2 -1
- package/validation/rules/NoUnusedVariables.mjs +6 -24
- package/validation/rules/OverlappingFieldsCanBeMerged.d.ts +24 -0
- package/validation/rules/OverlappingFieldsCanBeMerged.js +27 -46
- package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +17 -8
- package/validation/rules/OverlappingFieldsCanBeMerged.mjs +25 -44
- package/validation/rules/PossibleFragmentSpreads.d.ts +22 -0
- package/validation/rules/PossibleFragmentSpreads.js +2 -2
- package/validation/rules/PossibleFragmentSpreads.js.flow +8 -3
- package/validation/rules/PossibleFragmentSpreads.mjs +2 -2
- package/validation/rules/PossibleTypeExtensions.d.ts +21 -0
- package/validation/rules/PossibleTypeExtensions.js +4 -22
- package/validation/rules/PossibleTypeExtensions.js.flow +6 -2
- package/validation/rules/PossibleTypeExtensions.mjs +4 -22
- package/validation/rules/ProvidedRequiredArguments.d.ts +29 -0
- package/validation/rules/ProvidedRequiredArguments.js +27 -79
- package/validation/rules/ProvidedRequiredArguments.js.flow +12 -8
- package/validation/rules/ProvidedRequiredArguments.mjs +25 -77
- package/validation/rules/ScalarLeafs.d.ts +20 -0
- package/validation/rules/ScalarLeafs.js.flow +6 -2
- package/validation/rules/SingleFieldSubscriptions.d.ts +14 -0
- package/validation/rules/SingleFieldSubscriptions.js.flow +4 -2
- package/validation/rules/UniqueArgumentNames.d.ts +12 -0
- package/validation/rules/UniqueArgumentNames.js.flow +2 -1
- package/validation/rules/UniqueDirectiveNames.d.ts +13 -0
- package/validation/rules/UniqueDirectiveNames.js.flow +2 -1
- package/validation/rules/UniqueDirectivesPerLocation.d.ts +14 -0
- package/validation/rules/UniqueDirectivesPerLocation.js +15 -69
- package/validation/rules/UniqueDirectivesPerLocation.js.flow +7 -4
- package/validation/rules/UniqueDirectivesPerLocation.mjs +15 -69
- package/validation/rules/UniqueEnumValueNames.d.ts +19 -0
- package/validation/rules/UniqueEnumValueNames.js +10 -28
- package/validation/rules/UniqueEnumValueNames.js.flow +2 -1
- package/validation/rules/UniqueEnumValueNames.mjs +10 -28
- package/validation/rules/UniqueFieldDefinitionNames.d.ts +21 -0
- package/validation/rules/UniqueFieldDefinitionNames.js +9 -27
- package/validation/rules/UniqueFieldDefinitionNames.js.flow +2 -1
- package/validation/rules/UniqueFieldDefinitionNames.mjs +9 -27
- package/validation/rules/UniqueFragmentNames.d.ts +11 -0
- package/validation/rules/UniqueFragmentNames.js.flow +2 -1
- package/validation/rules/UniqueInputFieldNames.d.ts +14 -0
- package/validation/rules/UniqueInputFieldNames.js.flow +2 -1
- package/validation/rules/UniqueOperationNames.d.ts +11 -0
- package/validation/rules/UniqueOperationNames.js.flow +2 -1
- package/validation/rules/UniqueOperationTypes.d.ts +13 -0
- package/validation/rules/UniqueOperationTypes.js +11 -30
- package/validation/rules/UniqueOperationTypes.js.flow +2 -1
- package/validation/rules/UniqueOperationTypes.mjs +10 -29
- package/validation/rules/UniqueTypeNames.d.ts +13 -0
- package/validation/rules/UniqueTypeNames.js.flow +3 -1
- package/validation/rules/UniqueVariableNames.d.ts +11 -0
- package/validation/rules/UniqueVariableNames.js.flow +4 -2
- package/validation/rules/ValuesOfCorrectType.d.ts +34 -0
- package/validation/rules/ValuesOfCorrectType.js +16 -34
- package/validation/rules/ValuesOfCorrectType.js.flow +11 -6
- package/validation/rules/ValuesOfCorrectType.mjs +12 -30
- package/validation/rules/VariablesAreInputTypes.d.ts +15 -0
- package/validation/rules/VariablesAreInputTypes.js.flow +6 -2
- package/validation/rules/VariablesInAllowedPosition.d.ts +15 -0
- package/validation/rules/VariablesInAllowedPosition.js +22 -40
- package/validation/rules/VariablesInAllowedPosition.js.flow +8 -3
- package/validation/rules/VariablesInAllowedPosition.mjs +18 -36
- package/validation/specifiedRules.d.ts +98 -0
- package/validation/validate.d.ts +56 -0
- package/validation/validate.js +35 -7
- package/validation/validate.js.flow +51 -9
- package/validation/validate.mjs +30 -7
- package/version.d.ts +14 -0
- package/version.js +3 -3
- package/version.js.flow +3 -3
- package/version.mjs +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GraphQLError } from '../error/GraphQLError';
|
|
2
|
+
import { DocumentNode } from '../language/ast';
|
|
3
|
+
import { GraphQLSchema } from '../type/schema';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A validation rule which reports deprecated usages.
|
|
7
|
+
*
|
|
8
|
+
* Returns a list of GraphQLError instances describing each deprecated use.
|
|
9
|
+
*/
|
|
10
|
+
export function findDeprecatedUsages(
|
|
11
|
+
schema: GraphQLSchema,
|
|
12
|
+
ast: DocumentNode,
|
|
13
|
+
): GraphQLError[];
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
3
|
import { GraphQLError } from '../error/GraphQLError';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { type DocumentNode } from '../language/ast';
|
|
6
|
+
import { visit, visitWithTypeInfo } from '../language/visitor';
|
|
7
|
+
|
|
6
8
|
import { getNamedType } from '../type/definition';
|
|
7
9
|
import { type GraphQLSchema } from '../type/schema';
|
|
10
|
+
|
|
8
11
|
import { TypeInfo } from './TypeInfo';
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Maybe from '../tsutils/Maybe';
|
|
2
|
+
import { DocumentNode, OperationDefinitionNode } from '../language/ast';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns an operation AST given a document AST and optionally an operation
|
|
6
|
+
* name. If a name is not provided, an operation is only returned if only one is
|
|
7
|
+
* provided in the document.
|
|
8
|
+
*/
|
|
9
|
+
export function getOperationAST(
|
|
10
|
+
documentAST: DocumentNode,
|
|
11
|
+
operationName: Maybe<string>,
|
|
12
|
+
): Maybe<OperationDefinitionNode>;
|
|
@@ -14,40 +14,22 @@ var _kinds = require("../language/kinds");
|
|
|
14
14
|
*/
|
|
15
15
|
function getOperationAST(documentAST, operationName) {
|
|
16
16
|
var operation = null;
|
|
17
|
-
var _iteratorNormalCompletion = true;
|
|
18
|
-
var _didIteratorError = false;
|
|
19
|
-
var _iteratorError = undefined;
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var definition = _step.value;
|
|
18
|
+
for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {
|
|
19
|
+
var definition = _documentAST$definiti2[_i2];
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
operation = definition;
|
|
35
|
-
} else if (definition.name && definition.name.value === operationName) {
|
|
36
|
-
return definition;
|
|
21
|
+
if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) {
|
|
22
|
+
if (!operationName) {
|
|
23
|
+
// If no operation name was provided, only return an Operation if there
|
|
24
|
+
// is one defined in the document. Upon encountering the second, return
|
|
25
|
+
// null.
|
|
26
|
+
if (operation) {
|
|
27
|
+
return null;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_iteratorError = err;
|
|
43
|
-
} finally {
|
|
44
|
-
try {
|
|
45
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
46
|
-
_iterator.return();
|
|
47
|
-
}
|
|
48
|
-
} finally {
|
|
49
|
-
if (_didIteratorError) {
|
|
50
|
-
throw _iteratorError;
|
|
29
|
+
|
|
30
|
+
operation = definition;
|
|
31
|
+
} else if (definition.name && definition.name.value === operationName) {
|
|
32
|
+
return definition;
|
|
51
33
|
}
|
|
52
34
|
}
|
|
53
35
|
}
|
|
@@ -7,40 +7,22 @@ import { Kind } from '../language/kinds';
|
|
|
7
7
|
*/
|
|
8
8
|
export function getOperationAST(documentAST, operationName) {
|
|
9
9
|
var operation = null;
|
|
10
|
-
var _iteratorNormalCompletion = true;
|
|
11
|
-
var _didIteratorError = false;
|
|
12
|
-
var _iteratorError = undefined;
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var definition = _step.value;
|
|
11
|
+
for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {
|
|
12
|
+
var definition = _documentAST$definiti2[_i2];
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
operation = definition;
|
|
28
|
-
} else if (definition.name && definition.name.value === operationName) {
|
|
29
|
-
return definition;
|
|
14
|
+
if (definition.kind === Kind.OPERATION_DEFINITION) {
|
|
15
|
+
if (!operationName) {
|
|
16
|
+
// If no operation name was provided, only return an Operation if there
|
|
17
|
+
// is one defined in the document. Upon encountering the second, return
|
|
18
|
+
// null.
|
|
19
|
+
if (operation) {
|
|
20
|
+
return null;
|
|
30
21
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_iteratorError = err;
|
|
36
|
-
} finally {
|
|
37
|
-
try {
|
|
38
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
39
|
-
_iterator.return();
|
|
40
|
-
}
|
|
41
|
-
} finally {
|
|
42
|
-
if (_didIteratorError) {
|
|
43
|
-
throw _iteratorError;
|
|
22
|
+
|
|
23
|
+
operation = definition;
|
|
24
|
+
} else if (definition.name && definition.name.value === operationName) {
|
|
25
|
+
return definition;
|
|
44
26
|
}
|
|
45
27
|
}
|
|
46
28
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OperationDefinitionNode,
|
|
3
|
+
OperationTypeDefinitionNode,
|
|
4
|
+
} from '../language/ast';
|
|
5
|
+
import { GraphQLSchema } from '../type/schema';
|
|
6
|
+
import { GraphQLObjectType } from '../type/definition';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Extracts the root type of the operation from the schema.
|
|
10
|
+
*/
|
|
11
|
+
export function getOperationRootType(
|
|
12
|
+
schema: GraphQLSchema,
|
|
13
|
+
operation: OperationDefinitionNode | OperationTypeDefinitionNode,
|
|
14
|
+
): GraphQLObjectType;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
3
|
import { GraphQLError } from '../error/GraphQLError';
|
|
4
|
+
|
|
4
5
|
import {
|
|
5
6
|
type OperationDefinitionNode,
|
|
6
7
|
type OperationTypeDefinitionNode,
|
|
7
8
|
} from '../language/ast';
|
|
9
|
+
|
|
8
10
|
import { type GraphQLSchema } from '../type/schema';
|
|
9
11
|
import { type GraphQLObjectType } from '../type/definition';
|
|
10
12
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// The GraphQL query recommended for a full schema introspection.
|
|
2
|
+
export {
|
|
3
|
+
getIntrospectionQuery,
|
|
4
|
+
// @deprecated, use getIntrospectionQuery() - will be removed in v15
|
|
5
|
+
introspectionQuery,
|
|
6
|
+
} from './introspectionQuery';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
IntrospectionOptions,
|
|
10
|
+
IntrospectionQuery,
|
|
11
|
+
IntrospectionSchema,
|
|
12
|
+
IntrospectionType,
|
|
13
|
+
IntrospectionInputType,
|
|
14
|
+
IntrospectionOutputType,
|
|
15
|
+
IntrospectionScalarType,
|
|
16
|
+
IntrospectionObjectType,
|
|
17
|
+
IntrospectionInterfaceType,
|
|
18
|
+
IntrospectionUnionType,
|
|
19
|
+
IntrospectionEnumType,
|
|
20
|
+
IntrospectionInputObjectType,
|
|
21
|
+
IntrospectionTypeRef,
|
|
22
|
+
IntrospectionInputTypeRef,
|
|
23
|
+
IntrospectionOutputTypeRef,
|
|
24
|
+
IntrospectionNamedTypeRef,
|
|
25
|
+
IntrospectionListTypeRef,
|
|
26
|
+
IntrospectionNonNullTypeRef,
|
|
27
|
+
IntrospectionField,
|
|
28
|
+
IntrospectionInputValue,
|
|
29
|
+
IntrospectionEnumValue,
|
|
30
|
+
IntrospectionDirective,
|
|
31
|
+
} from './introspectionQuery';
|
|
32
|
+
|
|
33
|
+
// Gets the target Operation from a Document
|
|
34
|
+
export { getOperationAST } from './getOperationAST';
|
|
35
|
+
|
|
36
|
+
// Gets the Type for the target Operation AST.
|
|
37
|
+
export { getOperationRootType } from './getOperationRootType';
|
|
38
|
+
|
|
39
|
+
// Convert a GraphQLSchema to an IntrospectionQuery
|
|
40
|
+
export { introspectionFromSchema } from './introspectionFromSchema';
|
|
41
|
+
|
|
42
|
+
// Build a GraphQLSchema from an introspection result.
|
|
43
|
+
export { buildClientSchema } from './buildClientSchema';
|
|
44
|
+
|
|
45
|
+
// Build a GraphQLSchema from GraphQL Schema language.
|
|
46
|
+
export {
|
|
47
|
+
buildASTSchema,
|
|
48
|
+
buildSchema,
|
|
49
|
+
// @deprecated: Get the description from a schema AST node and supports legacy
|
|
50
|
+
// syntax for specifying descriptions - will be removed in v16
|
|
51
|
+
getDescription,
|
|
52
|
+
BuildSchemaOptions,
|
|
53
|
+
} from './buildASTSchema';
|
|
54
|
+
|
|
55
|
+
// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.
|
|
56
|
+
export { extendSchema } from './extendSchema';
|
|
57
|
+
|
|
58
|
+
// Sort a GraphQLSchema.
|
|
59
|
+
export { lexicographicSortSchema } from './lexicographicSortSchema';
|
|
60
|
+
|
|
61
|
+
// Print a GraphQLSchema to GraphQL Schema language.
|
|
62
|
+
export {
|
|
63
|
+
printSchema,
|
|
64
|
+
printType,
|
|
65
|
+
printIntrospectionSchema,
|
|
66
|
+
} from './schemaPrinter';
|
|
67
|
+
|
|
68
|
+
// Create a GraphQLType from a GraphQL language AST.
|
|
69
|
+
export { typeFromAST } from './typeFromAST';
|
|
70
|
+
|
|
71
|
+
// Create a JavaScript value from a GraphQL language AST with a type.
|
|
72
|
+
export { valueFromAST } from './valueFromAST';
|
|
73
|
+
|
|
74
|
+
// Create a JavaScript value from a GraphQL language AST without a type.
|
|
75
|
+
export { valueFromASTUntyped } from './valueFromASTUntyped';
|
|
76
|
+
|
|
77
|
+
// Create a GraphQL language AST from a JavaScript value.
|
|
78
|
+
export { astFromValue } from './astFromValue';
|
|
79
|
+
|
|
80
|
+
// A helper to use within recursive-descent visitors which need to be aware of
|
|
81
|
+
// the GraphQL type system.
|
|
82
|
+
export { TypeInfo } from './TypeInfo';
|
|
83
|
+
|
|
84
|
+
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
|
85
|
+
export { coerceInputValue } from './coerceInputValue';
|
|
86
|
+
|
|
87
|
+
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
|
88
|
+
export { coerceValue } from './coerceValue';
|
|
89
|
+
|
|
90
|
+
// @deprecated use coerceValue - will be removed in v15
|
|
91
|
+
export { isValidJSValue } from './isValidJSValue';
|
|
92
|
+
|
|
93
|
+
// @deprecated use validation - will be removed in v15
|
|
94
|
+
export { isValidLiteralValue } from './isValidLiteralValue';
|
|
95
|
+
|
|
96
|
+
// Concatenates multiple AST together.
|
|
97
|
+
export { concatAST } from './concatAST';
|
|
98
|
+
|
|
99
|
+
// Separates an AST into an AST per Operation.
|
|
100
|
+
export { separateOperations } from './separateOperations';
|
|
101
|
+
|
|
102
|
+
// Strips characters that are not significant to the validity or execution
|
|
103
|
+
// of a GraphQL document.
|
|
104
|
+
export { stripIgnoredCharacters } from './stripIgnoredCharacters';
|
|
105
|
+
|
|
106
|
+
// Comparators for types
|
|
107
|
+
export {
|
|
108
|
+
isEqualType,
|
|
109
|
+
isTypeSubTypeOf,
|
|
110
|
+
doTypesOverlap,
|
|
111
|
+
} from './typeComparators';
|
|
112
|
+
|
|
113
|
+
// Asserts that a string is a valid GraphQL name
|
|
114
|
+
export { assertValidName, isValidNameError } from './assertValidName';
|
|
115
|
+
|
|
116
|
+
// Compares two GraphQLSchemas and detects breaking changes.
|
|
117
|
+
export {
|
|
118
|
+
BreakingChangeType,
|
|
119
|
+
DangerousChangeType,
|
|
120
|
+
findBreakingChanges,
|
|
121
|
+
findDangerousChanges,
|
|
122
|
+
BreakingChange,
|
|
123
|
+
DangerousChange,
|
|
124
|
+
} from './findBreakingChanges';
|
|
125
|
+
|
|
126
|
+
// Report all deprecated usage within a GraphQL document.
|
|
127
|
+
export { findDeprecatedUsages } from './findDeprecatedUsages';
|
package/utilities/index.js
CHANGED
|
@@ -117,6 +117,12 @@ Object.defineProperty(exports, "TypeInfo", {
|
|
|
117
117
|
return _TypeInfo.TypeInfo;
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
|
+
Object.defineProperty(exports, "coerceInputValue", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function get() {
|
|
123
|
+
return _coerceInputValue.coerceInputValue;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
120
126
|
Object.defineProperty(exports, "coerceValue", {
|
|
121
127
|
enumerable: true,
|
|
122
128
|
get: function get() {
|
|
@@ -242,6 +248,8 @@ var _astFromValue = require("./astFromValue");
|
|
|
242
248
|
|
|
243
249
|
var _TypeInfo = require("./TypeInfo");
|
|
244
250
|
|
|
251
|
+
var _coerceInputValue = require("./coerceInputValue");
|
|
252
|
+
|
|
245
253
|
var _coerceValue = require("./coerceValue");
|
|
246
254
|
|
|
247
255
|
var _isValidJSValue = require("./isValidJSValue");
|
package/utilities/index.js.flow
CHANGED
|
@@ -86,9 +86,12 @@ export { astFromValue } from './astFromValue';
|
|
|
86
86
|
export { TypeInfo } from './TypeInfo';
|
|
87
87
|
|
|
88
88
|
// Coerces a JavaScript value to a GraphQL type, or produces errors.
|
|
89
|
+
export { coerceInputValue } from './coerceInputValue';
|
|
90
|
+
|
|
91
|
+
// @deprecated use coerceInputValue - will be removed in v15.
|
|
89
92
|
export { coerceValue } from './coerceValue';
|
|
90
93
|
|
|
91
|
-
// @deprecated use
|
|
94
|
+
// @deprecated use coerceInputValue - will be removed in v15.
|
|
92
95
|
export { isValidJSValue } from './isValidJSValue';
|
|
93
96
|
|
|
94
97
|
// @deprecated use validation - will be removed in v15
|
package/utilities/index.mjs
CHANGED
|
@@ -33,7 +33,9 @@ export { astFromValue } from './astFromValue'; // A helper to use within recursi
|
|
|
33
33
|
|
|
34
34
|
export { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors.
|
|
35
35
|
|
|
36
|
-
export {
|
|
36
|
+
export { coerceInputValue } from './coerceInputValue'; // @deprecated use coerceInputValue - will be removed in v15.
|
|
37
|
+
|
|
38
|
+
export { coerceValue } from './coerceValue'; // @deprecated use coerceInputValue - will be removed in v15.
|
|
37
39
|
|
|
38
40
|
export { isValidJSValue } from './isValidJSValue'; // @deprecated use validation - will be removed in v15
|
|
39
41
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GraphQLSchema } from '../type/schema';
|
|
2
|
+
import { IntrospectionQuery, IntrospectionOptions } from './introspectionQuery';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Build an IntrospectionQuery from a GraphQLSchema
|
|
6
|
+
*
|
|
7
|
+
* IntrospectionQuery is useful for utilities that care about type and field
|
|
8
|
+
* relationships, but do not need to traverse through those relationships.
|
|
9
|
+
*
|
|
10
|
+
* This is the inverse of buildClientSchema. The primary use case is outside
|
|
11
|
+
* of the server context, for instance when doing schema comparisons.
|
|
12
|
+
*/
|
|
13
|
+
export function introspectionFromSchema(
|
|
14
|
+
schema: GraphQLSchema,
|
|
15
|
+
options?: IntrospectionOptions,
|
|
16
|
+
): IntrospectionQuery;
|
|
@@ -9,10 +9,10 @@ var _invariant = _interopRequireDefault(require("../jsutils/invariant"));
|
|
|
9
9
|
|
|
10
10
|
var _isPromise = _interopRequireDefault(require("../jsutils/isPromise"));
|
|
11
11
|
|
|
12
|
-
var _execute = require("../execution/execute");
|
|
13
|
-
|
|
14
12
|
var _parser = require("../language/parser");
|
|
15
13
|
|
|
14
|
+
var _execute = require("../execution/execute");
|
|
15
|
+
|
|
16
16
|
var _introspectionQuery = require("./introspectionQuery");
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -29,6 +29,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
29
|
function introspectionFromSchema(schema, options) {
|
|
30
30
|
var queryAST = (0, _parser.parse)((0, _introspectionQuery.getIntrospectionQuery)(options));
|
|
31
31
|
var result = (0, _execute.execute)(schema, queryAST);
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
/* istanbul ignore next */
|
|
34
|
+
!(0, _isPromise.default)(result) && !result.errors && result.data || (0, _invariant.default)(0);
|
|
33
35
|
return result.data;
|
|
34
36
|
}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import invariant from '../jsutils/invariant';
|
|
4
4
|
import isPromise from '../jsutils/isPromise';
|
|
5
|
-
|
|
6
|
-
import { execute } from '../execution/execute';
|
|
5
|
+
|
|
7
6
|
import { parse } from '../language/parser';
|
|
7
|
+
import { execute } from '../execution/execute';
|
|
8
|
+
import { type GraphQLSchema } from '../type/schema';
|
|
9
|
+
|
|
8
10
|
import {
|
|
9
11
|
type IntrospectionQuery,
|
|
10
12
|
type IntrospectionOptions,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import invariant from '../jsutils/invariant';
|
|
2
2
|
import isPromise from '../jsutils/isPromise';
|
|
3
|
-
import { execute } from '../execution/execute';
|
|
4
3
|
import { parse } from '../language/parser';
|
|
4
|
+
import { execute } from '../execution/execute';
|
|
5
5
|
import { getIntrospectionQuery } from './introspectionQuery';
|
|
6
6
|
/**
|
|
7
7
|
* Build an IntrospectionQuery from a GraphQLSchema
|
|
@@ -16,6 +16,8 @@ import { getIntrospectionQuery } from './introspectionQuery';
|
|
|
16
16
|
export function introspectionFromSchema(schema, options) {
|
|
17
17
|
var queryAST = parse(getIntrospectionQuery(options));
|
|
18
18
|
var result = execute(schema, queryAST);
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
/* istanbul ignore next */
|
|
21
|
+
!isPromise(result) && !result.errors && result.data || invariant(0);
|
|
20
22
|
return result.data;
|
|
21
23
|
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import Maybe from '../tsutils/Maybe';
|
|
2
|
+
import { DirectiveLocationEnum } from '../language/directiveLocation';
|
|
3
|
+
|
|
4
|
+
export interface IntrospectionOptions {
|
|
5
|
+
// Whether to include descriptions in the introspection result.
|
|
6
|
+
// Default: true
|
|
7
|
+
descriptions: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getIntrospectionQuery(options?: IntrospectionOptions): string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Deprecated, call getIntrospectionQuery directly.
|
|
14
|
+
*
|
|
15
|
+
* This function will be removed in v15
|
|
16
|
+
*/
|
|
17
|
+
export const introspectionQuery: string;
|
|
18
|
+
|
|
19
|
+
export interface IntrospectionQuery {
|
|
20
|
+
readonly __schema: IntrospectionSchema;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface IntrospectionSchema {
|
|
24
|
+
readonly queryType: IntrospectionNamedTypeRef<IntrospectionObjectType>;
|
|
25
|
+
readonly mutationType: Maybe<
|
|
26
|
+
IntrospectionNamedTypeRef<IntrospectionObjectType>
|
|
27
|
+
>;
|
|
28
|
+
readonly subscriptionType: Maybe<
|
|
29
|
+
IntrospectionNamedTypeRef<IntrospectionObjectType>
|
|
30
|
+
>;
|
|
31
|
+
readonly types: ReadonlyArray<IntrospectionType>;
|
|
32
|
+
readonly directives: ReadonlyArray<IntrospectionDirective>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type IntrospectionType =
|
|
36
|
+
| IntrospectionScalarType
|
|
37
|
+
| IntrospectionObjectType
|
|
38
|
+
| IntrospectionInterfaceType
|
|
39
|
+
| IntrospectionUnionType
|
|
40
|
+
| IntrospectionEnumType
|
|
41
|
+
| IntrospectionInputObjectType;
|
|
42
|
+
|
|
43
|
+
export type IntrospectionOutputType =
|
|
44
|
+
| IntrospectionScalarType
|
|
45
|
+
| IntrospectionObjectType
|
|
46
|
+
| IntrospectionInterfaceType
|
|
47
|
+
| IntrospectionUnionType
|
|
48
|
+
| IntrospectionEnumType;
|
|
49
|
+
|
|
50
|
+
export type IntrospectionInputType =
|
|
51
|
+
| IntrospectionScalarType
|
|
52
|
+
| IntrospectionEnumType
|
|
53
|
+
| IntrospectionInputObjectType;
|
|
54
|
+
|
|
55
|
+
export interface IntrospectionScalarType {
|
|
56
|
+
readonly kind: 'SCALAR';
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly description?: Maybe<string>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface IntrospectionObjectType {
|
|
62
|
+
readonly kind: 'OBJECT';
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly description?: Maybe<string>;
|
|
65
|
+
readonly fields: ReadonlyArray<IntrospectionField>;
|
|
66
|
+
readonly interfaces: ReadonlyArray<
|
|
67
|
+
IntrospectionNamedTypeRef<IntrospectionInterfaceType>
|
|
68
|
+
>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IntrospectionInterfaceType {
|
|
72
|
+
readonly kind: 'INTERFACE';
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly description?: Maybe<string>;
|
|
75
|
+
readonly fields: ReadonlyArray<IntrospectionField>;
|
|
76
|
+
readonly possibleTypes: ReadonlyArray<
|
|
77
|
+
IntrospectionNamedTypeRef<IntrospectionObjectType>
|
|
78
|
+
>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface IntrospectionUnionType {
|
|
82
|
+
readonly kind: 'UNION';
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly description?: Maybe<string>;
|
|
85
|
+
readonly possibleTypes: ReadonlyArray<
|
|
86
|
+
IntrospectionNamedTypeRef<IntrospectionObjectType>
|
|
87
|
+
>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface IntrospectionEnumType {
|
|
91
|
+
readonly kind: 'ENUM';
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly description?: Maybe<string>;
|
|
94
|
+
readonly enumValues: ReadonlyArray<IntrospectionEnumValue>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface IntrospectionInputObjectType {
|
|
98
|
+
readonly kind: 'INPUT_OBJECT';
|
|
99
|
+
readonly name: string;
|
|
100
|
+
readonly description?: Maybe<string>;
|
|
101
|
+
readonly inputFields: ReadonlyArray<IntrospectionInputValue>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface IntrospectionListTypeRef<
|
|
105
|
+
T extends IntrospectionTypeRef = IntrospectionTypeRef
|
|
106
|
+
> {
|
|
107
|
+
readonly kind: 'LIST';
|
|
108
|
+
readonly ofType: T;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface IntrospectionNonNullTypeRef<
|
|
112
|
+
T extends IntrospectionTypeRef = IntrospectionTypeRef
|
|
113
|
+
> {
|
|
114
|
+
readonly kind: 'NON_NULL';
|
|
115
|
+
readonly ofType: T;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type IntrospectionTypeRef =
|
|
119
|
+
| IntrospectionNamedTypeRef<IntrospectionType>
|
|
120
|
+
| IntrospectionListTypeRef<any>
|
|
121
|
+
| IntrospectionNonNullTypeRef<
|
|
122
|
+
| IntrospectionNamedTypeRef<IntrospectionType>
|
|
123
|
+
| IntrospectionListTypeRef<any>
|
|
124
|
+
>;
|
|
125
|
+
|
|
126
|
+
export type IntrospectionOutputTypeRef =
|
|
127
|
+
| IntrospectionNamedTypeRef<IntrospectionOutputType>
|
|
128
|
+
| IntrospectionListTypeRef<any>
|
|
129
|
+
| IntrospectionNonNullTypeRef<
|
|
130
|
+
| IntrospectionNamedTypeRef<IntrospectionOutputType>
|
|
131
|
+
| IntrospectionListTypeRef<any>
|
|
132
|
+
>;
|
|
133
|
+
|
|
134
|
+
export type IntrospectionInputTypeRef =
|
|
135
|
+
| IntrospectionNamedTypeRef<IntrospectionInputType>
|
|
136
|
+
| IntrospectionListTypeRef<any>
|
|
137
|
+
| IntrospectionNonNullTypeRef<
|
|
138
|
+
| IntrospectionNamedTypeRef<IntrospectionInputType>
|
|
139
|
+
| IntrospectionListTypeRef<any>
|
|
140
|
+
>;
|
|
141
|
+
|
|
142
|
+
export interface IntrospectionNamedTypeRef<
|
|
143
|
+
T extends IntrospectionType = IntrospectionType
|
|
144
|
+
> {
|
|
145
|
+
readonly kind: T['kind'];
|
|
146
|
+
readonly name: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface IntrospectionField {
|
|
150
|
+
readonly name: string;
|
|
151
|
+
readonly description?: Maybe<string>;
|
|
152
|
+
readonly args: ReadonlyArray<IntrospectionInputValue>;
|
|
153
|
+
readonly type: IntrospectionOutputTypeRef;
|
|
154
|
+
readonly isDeprecated: boolean;
|
|
155
|
+
readonly deprecationReason?: Maybe<string>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface IntrospectionInputValue {
|
|
159
|
+
readonly name: string;
|
|
160
|
+
readonly description?: Maybe<string>;
|
|
161
|
+
readonly type: IntrospectionInputTypeRef;
|
|
162
|
+
readonly defaultValue?: Maybe<string>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface IntrospectionEnumValue {
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly description?: Maybe<string>;
|
|
168
|
+
readonly isDeprecated: boolean;
|
|
169
|
+
readonly deprecationReason?: Maybe<string>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface IntrospectionDirective {
|
|
173
|
+
readonly name: string;
|
|
174
|
+
readonly description?: Maybe<string>;
|
|
175
|
+
readonly locations: ReadonlyArray<DirectiveLocationEnum>;
|
|
176
|
+
readonly args: ReadonlyArray<IntrospectionInputValue>;
|
|
177
|
+
}
|
|
@@ -10,7 +10,7 @@ var _coerceValue = require("./coerceValue");
|
|
|
10
10
|
/* istanbul ignore file */
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Deprecated. Use
|
|
13
|
+
* Deprecated. Use coerceInputValue() directly for richer information.
|
|
14
14
|
*
|
|
15
15
|
* This function will be removed in v15
|
|
16
16
|
*/
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
3
|
/* istanbul ignore file */
|
|
4
|
-
import { coerceValue } from './coerceValue';
|
|
5
4
|
import { type GraphQLInputType } from '../type/definition';
|
|
6
5
|
|
|
6
|
+
import { coerceValue } from './coerceValue';
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
|
-
* Deprecated. Use
|
|
9
|
+
* Deprecated. Use coerceInputValue() directly for richer information.
|
|
9
10
|
*
|
|
10
11
|
* This function will be removed in v15
|
|
11
12
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* istanbul ignore file */
|
|
2
2
|
import { coerceValue } from './coerceValue';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
|
-
* Deprecated. Use
|
|
4
|
+
* Deprecated. Use coerceInputValue() directly for richer information.
|
|
6
5
|
*
|
|
7
6
|
* This function will be removed in v15
|
|
8
7
|
*/
|
|
8
|
+
|
|
9
9
|
export function isValidJSValue(value, type) {
|
|
10
10
|
var errors = coerceValue(value, type).errors;
|
|
11
11
|
return errors ? errors.map(function (error) {
|