graphql 15.1.0 → 15.4.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/LICENSE +1 -1
- package/README.md +10 -12
- package/error/GraphQLError.js +5 -5
- package/error/GraphQLError.js.flow +5 -5
- package/error/GraphQLError.mjs +1 -1
- package/error/formatError.js +1 -1
- package/error/formatError.js.flow +2 -3
- package/error/index.js +4 -4
- package/error/index.js.flow +0 -1
- package/error/locatedError.d.ts +2 -2
- package/error/locatedError.js +10 -5
- package/error/locatedError.js.flow +11 -5
- package/error/locatedError.mjs +6 -4
- package/error/syntaxError.js +1 -1
- package/error/syntaxError.js.flow +1 -2
- package/execution/execute.d.ts +24 -16
- package/execution/execute.js +123 -105
- package/execution/execute.js.flow +169 -153
- package/execution/execute.mjs +101 -82
- package/execution/index.d.ts +2 -0
- package/execution/index.js +9 -3
- package/execution/index.js.flow +12 -3
- package/execution/index.mjs +1 -1
- package/execution/values.js +11 -11
- package/execution/values.js.flow +10 -14
- package/graphql.js +5 -5
- package/graphql.js.flow +9 -9
- package/index.d.ts +19 -1
- package/index.js +27 -9
- package/index.js.flow +10 -3
- package/index.mjs +4 -3
- package/jsutils/ObjMap.js.flow +0 -1
- package/jsutils/Path.d.ts +6 -1
- package/jsutils/Path.js +3 -2
- package/jsutils/Path.js.flow +3 -2
- package/jsutils/Path.mjs +3 -2
- package/jsutils/PromiseOrValue.js.flow +0 -1
- package/jsutils/defineInspect.js +2 -2
- package/jsutils/defineInspect.js.flow +0 -1
- package/jsutils/devAssert.js.flow +0 -1
- package/jsutils/didYouMean.js.flow +0 -1
- package/jsutils/identityFunc.js.flow +0 -1
- package/jsutils/inspect.js +1 -2
- package/jsutils/inspect.js.flow +10 -8
- package/jsutils/inspect.mjs +1 -1
- package/jsutils/instanceOf.js.flow +2 -3
- package/jsutils/invariant.js.flow +0 -1
- package/jsutils/isAsyncIterable.js +19 -0
- package/jsutils/isAsyncIterable.js.flow +18 -0
- package/jsutils/isAsyncIterable.mjs +16 -0
- package/jsutils/isCollection.js +1 -1
- package/jsutils/isCollection.js.flow +0 -1
- package/jsutils/isObjectLike.js.flow +0 -1
- package/jsutils/isPromise.js.flow +0 -1
- package/jsutils/keyMap.js.flow +1 -2
- package/jsutils/keyValMap.js.flow +1 -2
- package/jsutils/mapValue.js +1 -1
- package/jsutils/mapValue.js.flow +1 -2
- package/jsutils/memoize3.js +2 -5
- package/jsutils/memoize3.js.flow +2 -5
- package/jsutils/memoize3.mjs +2 -5
- package/jsutils/nodejsCustomInspectSymbol.js.flow +0 -1
- package/jsutils/printPathArray.js.flow +0 -1
- package/jsutils/promiseForObject.js.flow +1 -2
- package/jsutils/promiseReduce.js +1 -1
- package/jsutils/promiseReduce.js.flow +1 -1
- package/jsutils/promiseReduce.mjs +1 -1
- package/jsutils/suggestionList.js.flow +1 -2
- package/jsutils/toObjMap.js +1 -1
- package/jsutils/toObjMap.js.flow +5 -6
- package/language/ast.js +1 -1
- package/language/ast.js.flow +2 -3
- package/language/blockString.d.ts +1 -1
- package/language/blockString.js +53 -32
- package/language/blockString.js.flow +49 -34
- package/language/blockString.mjs +54 -33
- package/language/directiveLocation.js.flow +0 -1
- package/language/experimentalOnlineParser/grammar.d.ts +1006 -0
- package/language/experimentalOnlineParser/grammar.js +987 -0
- package/language/experimentalOnlineParser/grammar.js.flow +1000 -0
- package/language/experimentalOnlineParser/grammar.mjs +980 -0
- package/language/experimentalOnlineParser/index.d.ts +6 -0
- package/language/experimentalOnlineParser/index.js +31 -0
- package/language/experimentalOnlineParser/index.js.flow +7 -0
- package/language/experimentalOnlineParser/index.mjs +1 -0
- package/language/experimentalOnlineParser/onlineParser.d.ts +125 -0
- package/language/experimentalOnlineParser/onlineParser.js +604 -0
- package/language/experimentalOnlineParser/onlineParser.js.flow +723 -0
- package/language/experimentalOnlineParser/onlineParser.mjs +587 -0
- package/language/index.js +12 -12
- package/language/index.js.flow +0 -1
- package/language/kinds.js.flow +0 -1
- package/language/lexer.js +242 -183
- package/language/lexer.js.flow +191 -186
- package/language/lexer.mjs +239 -180
- package/language/location.js.flow +1 -2
- package/language/parser.js +73 -68
- package/language/parser.js.flow +112 -106
- package/language/parser.mjs +66 -62
- package/language/predicates.js +1 -1
- package/language/predicates.js.flow +1 -2
- package/language/printLocation.js +1 -1
- package/language/printLocation.js.flow +4 -4
- package/language/printer.js +20 -13
- package/language/printer.js.flow +27 -25
- package/language/printer.mjs +18 -11
- package/language/source.d.ts +12 -6
- package/language/source.js +25 -9
- package/language/source.js.flow +25 -8
- package/language/source.mjs +19 -7
- package/language/tokenKind.js.flow +0 -1
- package/language/visitor.d.ts +3 -3
- package/language/visitor.js +5 -5
- package/language/visitor.js.flow +5 -5
- package/language/visitor.mjs +3 -3
- package/package.json +1 -1
- package/polyfills/arrayFrom.js +2 -2
- package/polyfills/arrayFrom.js.flow +1 -2
- package/polyfills/arrayFrom.mjs +1 -1
- package/polyfills/find.js +1 -1
- package/polyfills/find.js.flow +1 -2
- package/polyfills/find.mjs +1 -1
- package/polyfills/isFinite.js +1 -1
- package/polyfills/isFinite.js.flow +1 -2
- package/polyfills/isFinite.mjs +1 -1
- package/polyfills/isInteger.js +1 -1
- package/polyfills/isInteger.js.flow +1 -2
- package/polyfills/isInteger.mjs +1 -1
- package/polyfills/objectEntries.js +1 -1
- package/polyfills/objectEntries.js.flow +2 -3
- package/polyfills/objectEntries.mjs +1 -1
- package/polyfills/objectValues.js +1 -1
- package/polyfills/objectValues.js.flow +2 -3
- package/polyfills/objectValues.mjs +1 -1
- package/polyfills/symbols.js +3 -5
- package/polyfills/symbols.js.flow +9 -6
- package/polyfills/symbols.mjs +3 -5
- package/subscription/index.js +1 -1
- package/subscription/index.js.flow +0 -1
- package/subscription/mapAsyncIterator.js +2 -2
- package/subscription/mapAsyncIterator.js.flow +9 -10
- package/subscription/mapAsyncIterator.mjs +1 -1
- package/subscription/subscribe.js +61 -73
- package/subscription/subscribe.js.flow +74 -88
- package/subscription/subscribe.mjs +53 -65
- package/type/definition.d.ts +181 -31
- package/type/definition.js +37 -32
- package/type/definition.js.flow +66 -51
- package/type/definition.mjs +20 -18
- package/type/directives.d.ts +17 -3
- package/type/directives.js +17 -16
- package/type/directives.js.flow +20 -21
- package/type/directives.mjs +6 -5
- package/type/index.d.ts +12 -0
- package/type/index.js +6 -6
- package/type/index.js.flow +0 -1
- package/type/introspection.js +86 -68
- package/type/introspection.js.flow +85 -54
- package/type/introspection.mjs +79 -61
- package/type/scalars.js +9 -9
- package/type/scalars.js.flow +3 -3
- package/type/scalars.mjs +1 -1
- package/type/schema.d.ts +17 -4
- package/type/schema.js +13 -13
- package/type/schema.js.flow +18 -16
- package/type/schema.mjs +1 -1
- package/type/validate.js +52 -19
- package/type/validate.js.flow +67 -18
- package/type/validate.mjs +44 -10
- package/utilities/TypeInfo.js +7 -7
- package/utilities/TypeInfo.js.flow +16 -18
- package/utilities/TypeInfo.mjs +1 -1
- package/utilities/assertValidName.js +2 -2
- package/utilities/assertValidName.js.flow +0 -1
- package/utilities/astFromValue.js +10 -10
- package/utilities/astFromValue.js.flow +2 -3
- package/utilities/buildASTSchema.js +17 -27
- package/utilities/buildASTSchema.js.flow +11 -28
- package/utilities/buildASTSchema.mjs +11 -21
- package/utilities/buildClientSchema.js +14 -14
- package/utilities/buildClientSchema.js.flow +41 -29
- package/utilities/buildClientSchema.mjs +5 -5
- package/utilities/coerceInputValue.js +14 -14
- package/utilities/coerceInputValue.js.flow +7 -6
- package/utilities/coerceInputValue.mjs +2 -2
- package/utilities/concatAST.js +9 -8
- package/utilities/concatAST.js.flow +9 -9
- package/utilities/concatAST.mjs +9 -6
- package/utilities/extendSchema.js +26 -19
- package/utilities/extendSchema.js.flow +58 -45
- package/utilities/extendSchema.mjs +9 -2
- package/utilities/findBreakingChanges.js +9 -9
- package/utilities/findBreakingChanges.js.flow +12 -11
- package/utilities/findDeprecatedUsages.d.ts +9 -1
- package/utilities/findDeprecatedUsages.js +11 -27
- package/utilities/findDeprecatedUsages.js.flow +15 -44
- package/utilities/findDeprecatedUsages.mjs +11 -25
- package/utilities/getIntrospectionQuery.js.flow +2 -3
- package/utilities/getOperationAST.js +1 -1
- package/utilities/getOperationAST.js.flow +1 -5
- package/utilities/getOperationAST.mjs +1 -1
- package/utilities/getOperationRootType.js +1 -1
- package/utilities/getOperationRootType.js.flow +5 -6
- package/utilities/index.d.ts +4 -1
- package/utilities/index.js +22 -22
- package/utilities/index.js.flow +1 -2
- package/utilities/index.mjs +1 -1
- package/utilities/introspectionFromSchema.js +6 -8
- package/utilities/introspectionFromSchema.js.flow +10 -10
- package/utilities/introspectionFromSchema.mjs +3 -4
- package/utilities/lexicographicSortSchema.js +10 -8
- package/utilities/lexicographicSortSchema.js.flow +19 -12
- package/utilities/lexicographicSortSchema.mjs +3 -1
- package/utilities/printSchema.js +15 -16
- package/utilities/printSchema.js.flow +34 -25
- package/utilities/printSchema.mjs +6 -7
- package/utilities/separateOperations.js +2 -2
- package/utilities/separateOperations.js.flow +2 -6
- package/utilities/separateOperations.mjs +1 -1
- package/utilities/stripIgnoredCharacters.js +6 -16
- package/utilities/stripIgnoredCharacters.js.flow +4 -13
- package/utilities/stripIgnoredCharacters.mjs +3 -10
- package/utilities/typeComparators.js +1 -1
- package/utilities/typeComparators.js.flow +2 -4
- package/utilities/typeFromAST.js +6 -6
- package/utilities/typeFromAST.js.flow +11 -14
- package/utilities/typeFromAST.mjs +2 -2
- package/utilities/typedQueryDocumentNode.d.ts +20 -0
- package/utilities/valueFromAST.js +6 -6
- package/utilities/valueFromAST.js.flow +7 -5
- package/utilities/valueFromASTUntyped.js +4 -4
- package/utilities/valueFromASTUntyped.js.flow +2 -3
- package/validation/ValidationContext.d.ts +3 -0
- package/validation/ValidationContext.js +7 -3
- package/validation/ValidationContext.js.flow +28 -22
- package/validation/ValidationContext.mjs +4 -0
- package/validation/index.d.ts +4 -0
- package/validation/index.js +52 -36
- package/validation/index.js.flow +4 -1
- package/validation/index.mjs +4 -1
- package/validation/rules/ExecutableDefinitions.js +1 -1
- package/validation/rules/ExecutableDefinitions.js.flow +0 -1
- package/validation/rules/ExecutableDefinitionsRule.js +3 -3
- package/validation/rules/ExecutableDefinitionsRule.js.flow +2 -3
- package/validation/rules/FieldsOnCorrectTypeRule.js +5 -5
- package/validation/rules/FieldsOnCorrectTypeRule.js.flow +9 -8
- package/validation/rules/FragmentsOnCompositeTypesRule.js +4 -4
- package/validation/rules/FragmentsOnCompositeTypesRule.js.flow +2 -3
- package/validation/rules/KnownArgumentNamesRule.js +5 -5
- package/validation/rules/KnownArgumentNamesRule.js.flow +5 -5
- package/validation/rules/KnownDirectivesRule.js +6 -6
- package/validation/rules/KnownDirectivesRule.js.flow +10 -11
- package/validation/rules/KnownFragmentNamesRule.js +1 -1
- package/validation/rules/KnownFragmentNamesRule.js.flow +3 -3
- package/validation/rules/KnownTypeNamesRule.js +12 -10
- package/validation/rules/KnownTypeNamesRule.js.flow +14 -11
- package/validation/rules/KnownTypeNamesRule.mjs +6 -5
- package/validation/rules/LoneAnonymousOperationRule.js +2 -2
- package/validation/rules/LoneAnonymousOperationRule.js.flow +2 -3
- package/validation/rules/LoneSchemaDefinition.js +1 -1
- package/validation/rules/LoneSchemaDefinition.js.flow +0 -1
- package/validation/rules/LoneSchemaDefinitionRule.js +1 -1
- package/validation/rules/LoneSchemaDefinitionRule.js.flow +2 -3
- package/validation/rules/NoFragmentCyclesRule.js +1 -1
- package/validation/rules/NoFragmentCyclesRule.js.flow +4 -5
- package/validation/rules/NoUndefinedVariablesRule.js +1 -1
- package/validation/rules/NoUndefinedVariablesRule.js.flow +3 -3
- package/validation/rules/NoUnusedFragmentsRule.js +1 -1
- package/validation/rules/NoUnusedFragmentsRule.js.flow +3 -3
- package/validation/rules/NoUnusedVariablesRule.js +1 -1
- package/validation/rules/NoUnusedVariablesRule.js.flow +3 -3
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js +20 -20
- package/validation/rules/OverlappingFieldsCanBeMergedRule.js.flow +29 -27
- package/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +12 -12
- package/validation/rules/PossibleFragmentSpreadsRule.js +5 -5
- package/validation/rules/PossibleFragmentSpreadsRule.js.flow +7 -4
- package/validation/rules/PossibleTypeExtensions.js +1 -1
- package/validation/rules/PossibleTypeExtensions.js.flow +0 -1
- package/validation/rules/PossibleTypeExtensionsRule.js +8 -8
- package/validation/rules/PossibleTypeExtensionsRule.js.flow +8 -6
- package/validation/rules/ProvidedRequiredArgumentsRule.js +7 -7
- package/validation/rules/ProvidedRequiredArgumentsRule.js.flow +7 -6
- package/validation/rules/ScalarLeafsRule.js +3 -3
- package/validation/rules/ScalarLeafsRule.js.flow +3 -4
- package/validation/rules/SingleFieldSubscriptionsRule.js +1 -1
- package/validation/rules/SingleFieldSubscriptionsRule.js.flow +3 -4
- package/validation/rules/UniqueArgumentNamesRule.js +1 -1
- package/validation/rules/UniqueArgumentNamesRule.js.flow +2 -3
- package/validation/rules/UniqueDirectiveNames.js +1 -1
- package/validation/rules/UniqueDirectiveNames.js.flow +0 -1
- package/validation/rules/UniqueDirectiveNamesRule.js +1 -1
- package/validation/rules/UniqueDirectiveNamesRule.js.flow +2 -3
- package/validation/rules/UniqueDirectivesPerLocationRule.js +4 -4
- package/validation/rules/UniqueDirectivesPerLocationRule.js.flow +4 -5
- package/validation/rules/UniqueEnumValueNames.js +1 -1
- package/validation/rules/UniqueEnumValueNames.js.flow +0 -1
- package/validation/rules/UniqueEnumValueNamesRule.js +2 -2
- package/validation/rules/UniqueEnumValueNamesRule.js.flow +11 -4
- package/validation/rules/UniqueFieldDefinitionNames.js +1 -1
- package/validation/rules/UniqueFieldDefinitionNames.js.flow +0 -1
- package/validation/rules/UniqueFieldDefinitionNamesRule.js +3 -3
- package/validation/rules/UniqueFieldDefinitionNamesRule.js.flow +17 -6
- package/validation/rules/UniqueFieldDefinitionNamesRule.mjs +1 -1
- package/validation/rules/UniqueFragmentNamesRule.js +1 -1
- package/validation/rules/UniqueFragmentNamesRule.js.flow +3 -3
- package/validation/rules/UniqueInputFieldNamesRule.js +1 -1
- package/validation/rules/UniqueInputFieldNamesRule.js.flow +3 -3
- package/validation/rules/UniqueOperationNamesRule.js +1 -1
- package/validation/rules/UniqueOperationNamesRule.js.flow +3 -3
- package/validation/rules/UniqueOperationTypes.js +1 -1
- package/validation/rules/UniqueOperationTypes.js.flow +0 -1
- package/validation/rules/UniqueOperationTypesRule.js +1 -1
- package/validation/rules/UniqueOperationTypesRule.js.flow +10 -4
- package/validation/rules/UniqueTypeNames.js +1 -1
- package/validation/rules/UniqueTypeNames.js.flow +0 -1
- package/validation/rules/UniqueTypeNamesRule.js +1 -1
- package/validation/rules/UniqueTypeNamesRule.js.flow +3 -4
- package/validation/rules/UniqueVariableNamesRule.js +1 -1
- package/validation/rules/UniqueVariableNamesRule.js.flow +3 -4
- package/validation/rules/ValuesOfCorrectTypeRule.js +8 -8
- package/validation/rules/ValuesOfCorrectTypeRule.js.flow +3 -4
- package/validation/rules/VariablesAreInputTypesRule.js +4 -4
- package/validation/rules/VariablesAreInputTypesRule.js.flow +3 -4
- package/validation/rules/VariablesInAllowedPositionRule.js +6 -6
- package/validation/rules/VariablesInAllowedPositionRule.js.flow +6 -6
- package/validation/rules/custom/NoDeprecatedCustomRule.d.ts +14 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.js +79 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.js.flow +94 -0
- package/validation/rules/custom/NoDeprecatedCustomRule.mjs +68 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +16 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +34 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow +38 -0
- package/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +25 -0
- package/validation/specifiedRules.js +33 -33
- package/validation/specifiedRules.js.flow +0 -1
- package/validation/validate.js +7 -7
- package/validation/validate.js.flow +4 -9
- package/version.js +2 -2
- package/version.js.flow +2 -3
- package/version.mjs +2 -2
- package/polyfills/flatMap.js +0 -30
- package/polyfills/flatMap.js.flow +0 -28
- package/polyfills/flatMap.mjs +0 -23
package/execution/execute.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { Kind } from "../language/kinds.mjs";
|
|
|
15
15
|
import { assertValidSchema } from "../type/validate.mjs";
|
|
16
16
|
import { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from "../type/introspection.mjs";
|
|
17
17
|
import { GraphQLIncludeDirective, GraphQLSkipDirective } from "../type/directives.mjs";
|
|
18
|
-
import { isObjectType, isAbstractType, isLeafType, isListType, isNonNullType } from "../type/definition.mjs";
|
|
18
|
+
import { isNamedType, isObjectType, isAbstractType, isLeafType, isListType, isNonNullType } from "../type/definition.mjs";
|
|
19
19
|
import { typeFromAST } from "../utilities/typeFromAST.mjs";
|
|
20
20
|
import { getOperationRootType } from "../utilities/getOperationRootType.mjs";
|
|
21
21
|
import { getVariableValues, getArgumentValues, getDirectiveValues } from "./values.mjs";
|
|
@@ -60,6 +60,21 @@ export function execute(argsOrSchema, document, rootValue, contextValue, variabl
|
|
|
60
60
|
typeResolver: typeResolver
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Also implements the "Evaluating requests" section of the GraphQL specification.
|
|
65
|
+
* However, it guarantees to complete synchronously (or throw an error) assuming
|
|
66
|
+
* that all field resolvers are also synchronous.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export function executeSync(args) {
|
|
70
|
+
var result = executeImpl(args); // Assert that the execution was synchronous.
|
|
71
|
+
|
|
72
|
+
if (isPromise(result)) {
|
|
73
|
+
throw new Error('GraphQL execution failed to complete synchronously.');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
63
78
|
|
|
64
79
|
function executeImpl(args) {
|
|
65
80
|
var schema = args.schema,
|
|
@@ -205,8 +220,6 @@ function executeOperation(exeContext, operation, rootValue) {
|
|
|
205
220
|
var path = undefined; // Errors from sub-fields of a NonNull type may propagate to the top level,
|
|
206
221
|
// at which point we still log the error and null the parent field, which
|
|
207
222
|
// in this case is the entire response.
|
|
208
|
-
//
|
|
209
|
-
// Similar to completeValueCatchingError.
|
|
210
223
|
|
|
211
224
|
try {
|
|
212
225
|
var result = operation.operation === 'mutation' ? executeFieldsSerially(exeContext, type, rootValue, path, fields) : executeFields(exeContext, type, rootValue, path, fields);
|
|
@@ -233,7 +246,7 @@ function executeOperation(exeContext, operation, rootValue) {
|
|
|
233
246
|
function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) {
|
|
234
247
|
return promiseReduce(Object.keys(fields), function (results, responseName) {
|
|
235
248
|
var fieldNodes = fields[responseName];
|
|
236
|
-
var fieldPath = addPath(path, responseName);
|
|
249
|
+
var fieldPath = addPath(path, responseName, parentType.name);
|
|
237
250
|
var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath);
|
|
238
251
|
|
|
239
252
|
if (result === undefined) {
|
|
@@ -264,13 +277,13 @@ function executeFields(exeContext, parentType, sourceValue, path, fields) {
|
|
|
264
277
|
for (var _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) {
|
|
265
278
|
var responseName = _Object$keys2[_i4];
|
|
266
279
|
var fieldNodes = fields[responseName];
|
|
267
|
-
var fieldPath = addPath(path, responseName);
|
|
280
|
+
var fieldPath = addPath(path, responseName, parentType.name);
|
|
268
281
|
var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath);
|
|
269
282
|
|
|
270
283
|
if (result !== undefined) {
|
|
271
284
|
results[responseName] = result;
|
|
272
285
|
|
|
273
|
-
if (
|
|
286
|
+
if (isPromise(result)) {
|
|
274
287
|
containsPromise = true;
|
|
275
288
|
}
|
|
276
289
|
}
|
|
@@ -423,42 +436,10 @@ function resolveField(exeContext, parentType, source, fieldNodes, path) {
|
|
|
423
436
|
return;
|
|
424
437
|
}
|
|
425
438
|
|
|
439
|
+
var returnType = fieldDef.type;
|
|
426
440
|
var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _fieldDef$resolve : exeContext.fieldResolver;
|
|
427
|
-
var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal
|
|
428
|
-
// or abrupt (error).
|
|
429
|
-
|
|
430
|
-
var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info);
|
|
431
|
-
return completeValueCatchingError(exeContext, fieldDef.type, fieldNodes, info, path, result);
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* @internal
|
|
435
|
-
*/
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
export function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) {
|
|
439
|
-
// The resolve function's optional fourth argument is a collection of
|
|
440
|
-
// information about the current execution state.
|
|
441
|
-
return {
|
|
442
|
-
fieldName: fieldDef.name,
|
|
443
|
-
fieldNodes: fieldNodes,
|
|
444
|
-
returnType: fieldDef.type,
|
|
445
|
-
parentType: parentType,
|
|
446
|
-
path: path,
|
|
447
|
-
schema: exeContext.schema,
|
|
448
|
-
fragments: exeContext.fragments,
|
|
449
|
-
rootValue: exeContext.rootValue,
|
|
450
|
-
operation: exeContext.operation,
|
|
451
|
-
variableValues: exeContext.variableValues
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField`
|
|
456
|
-
* function. Returns the result of resolveFn or the abrupt-return Error object.
|
|
457
|
-
*
|
|
458
|
-
* @internal
|
|
459
|
-
*/
|
|
441
|
+
var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal or abrupt (error).
|
|
460
442
|
|
|
461
|
-
export function resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info) {
|
|
462
443
|
try {
|
|
463
444
|
// Build a JS object of arguments from the field.arguments AST, using the
|
|
464
445
|
// variables scope to fulfill any variable references.
|
|
@@ -469,25 +450,6 @@ export function resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resol
|
|
|
469
450
|
|
|
470
451
|
var _contextValue = exeContext.contextValue;
|
|
471
452
|
var result = resolveFn(source, args, _contextValue, info);
|
|
472
|
-
return isPromise(result) ? result.then(undefined, asErrorInstance) : result;
|
|
473
|
-
} catch (error) {
|
|
474
|
-
return asErrorInstance(error);
|
|
475
|
-
}
|
|
476
|
-
} // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a
|
|
477
|
-
// consistent Error interface.
|
|
478
|
-
|
|
479
|
-
function asErrorInstance(error) {
|
|
480
|
-
if (error instanceof Error) {
|
|
481
|
-
return error;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
return new Error('Unexpected error value: ' + inspect(error));
|
|
485
|
-
} // This is a small wrapper around completeValue which detects and logs errors
|
|
486
|
-
// in the execution context.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) {
|
|
490
|
-
try {
|
|
491
453
|
var completed;
|
|
492
454
|
|
|
493
455
|
if (isPromise(result)) {
|
|
@@ -501,21 +463,43 @@ function completeValueCatchingError(exeContext, returnType, fieldNodes, info, pa
|
|
|
501
463
|
if (isPromise(completed)) {
|
|
502
464
|
// Note: we don't rely on a `catch` method, but we do expect "thenable"
|
|
503
465
|
// to take a second callback for the error case.
|
|
504
|
-
return completed.then(undefined, function (
|
|
505
|
-
|
|
466
|
+
return completed.then(undefined, function (rawError) {
|
|
467
|
+
var error = locatedError(rawError, fieldNodes, pathToArray(path));
|
|
468
|
+
return handleFieldError(error, returnType, exeContext);
|
|
506
469
|
});
|
|
507
470
|
}
|
|
508
471
|
|
|
509
472
|
return completed;
|
|
510
|
-
} catch (
|
|
511
|
-
|
|
473
|
+
} catch (rawError) {
|
|
474
|
+
var error = locatedError(rawError, fieldNodes, pathToArray(path));
|
|
475
|
+
return handleFieldError(error, returnType, exeContext);
|
|
512
476
|
}
|
|
513
477
|
}
|
|
478
|
+
/**
|
|
479
|
+
* @internal
|
|
480
|
+
*/
|
|
514
481
|
|
|
515
|
-
function handleFieldError(rawError, fieldNodes, path, returnType, exeContext) {
|
|
516
|
-
var error = locatedError(asErrorInstance(rawError), fieldNodes, pathToArray(path)); // If the field type is non-nullable, then it is resolved without any
|
|
517
|
-
// protection from errors, however it still properly locates the error.
|
|
518
482
|
|
|
483
|
+
export function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) {
|
|
484
|
+
// The resolve function's optional fourth argument is a collection of
|
|
485
|
+
// information about the current execution state.
|
|
486
|
+
return {
|
|
487
|
+
fieldName: fieldDef.name,
|
|
488
|
+
fieldNodes: fieldNodes,
|
|
489
|
+
returnType: fieldDef.type,
|
|
490
|
+
parentType: parentType,
|
|
491
|
+
path: path,
|
|
492
|
+
schema: exeContext.schema,
|
|
493
|
+
fragments: exeContext.fragments,
|
|
494
|
+
rootValue: exeContext.rootValue,
|
|
495
|
+
operation: exeContext.operation,
|
|
496
|
+
variableValues: exeContext.variableValues
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function handleFieldError(error, returnType, exeContext) {
|
|
501
|
+
// If the field type is non-nullable, then it is resolved without any
|
|
502
|
+
// protection from errors, however it still properly locates the error.
|
|
519
503
|
if (isNonNullType(returnType)) {
|
|
520
504
|
throw error;
|
|
521
505
|
} // Otherwise, error protection is applied, logging the error and resolving
|
|
@@ -615,14 +599,34 @@ function completeListValue(exeContext, returnType, fieldNodes, info, path, resul
|
|
|
615
599
|
var completedResults = arrayFrom(result, function (item, index) {
|
|
616
600
|
// No need to modify the info object containing the path,
|
|
617
601
|
// since from here on it is not ever accessed by resolver functions.
|
|
618
|
-
var
|
|
619
|
-
var completedItem = completeValueCatchingError(exeContext, itemType, fieldNodes, info, fieldPath, item);
|
|
602
|
+
var itemPath = addPath(path, index, undefined);
|
|
620
603
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
604
|
+
try {
|
|
605
|
+
var completedItem;
|
|
606
|
+
|
|
607
|
+
if (isPromise(item)) {
|
|
608
|
+
completedItem = item.then(function (resolved) {
|
|
609
|
+
return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved);
|
|
610
|
+
});
|
|
611
|
+
} else {
|
|
612
|
+
completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (isPromise(completedItem)) {
|
|
616
|
+
containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect "thenable"
|
|
617
|
+
// to take a second callback for the error case.
|
|
624
618
|
|
|
625
|
-
|
|
619
|
+
return completedItem.then(undefined, function (rawError) {
|
|
620
|
+
var error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
621
|
+
return handleFieldError(error, itemType, exeContext);
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
return completedItem;
|
|
626
|
+
} catch (rawError) {
|
|
627
|
+
var error = locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
628
|
+
return handleFieldError(error, itemType, exeContext);
|
|
629
|
+
}
|
|
626
630
|
});
|
|
627
631
|
return containsPromise ? Promise.all(completedResults) : completedResults;
|
|
628
632
|
}
|
|
@@ -664,10 +668,25 @@ function completeAbstractValue(exeContext, returnType, fieldNodes, info, path, r
|
|
|
664
668
|
}
|
|
665
669
|
|
|
666
670
|
function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) {
|
|
667
|
-
|
|
671
|
+
if (runtimeTypeOrName == null) {
|
|
672
|
+
throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" must resolve to an Object type at runtime for field \"").concat(info.parentType.name, ".").concat(info.fieldName, "\". Either the \"").concat(returnType.name, "\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes);
|
|
673
|
+
} // FIXME: temporary workaround until support for passing object types would be removed in v16.0.0
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
var runtimeTypeName = isNamedType(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName;
|
|
677
|
+
|
|
678
|
+
if (typeof runtimeTypeName !== 'string') {
|
|
679
|
+
throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" must resolve to an Object type at runtime for field \"").concat(info.parentType.name, ".").concat(info.fieldName, "\" with ") + "value ".concat(inspect(result), ", received \"").concat(inspect(runtimeTypeOrName), "\"."));
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
var runtimeType = exeContext.schema.getType(runtimeTypeName);
|
|
683
|
+
|
|
684
|
+
if (runtimeType == null) {
|
|
685
|
+
throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a type \"").concat(runtimeTypeName, "\" that does not exist inside schema."), fieldNodes);
|
|
686
|
+
}
|
|
668
687
|
|
|
669
688
|
if (!isObjectType(runtimeType)) {
|
|
670
|
-
throw new GraphQLError("Abstract type \"".concat(returnType.name, "\"
|
|
689
|
+
throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a non-object type \"").concat(runtimeTypeName, "\"."), fieldNodes);
|
|
671
690
|
}
|
|
672
691
|
|
|
673
692
|
if (!exeContext.schema.isSubType(returnType, runtimeType)) {
|
|
@@ -769,7 +788,7 @@ export var defaultTypeResolver = function defaultTypeResolver(value, contextValu
|
|
|
769
788
|
if (isPromise(isTypeOfResult)) {
|
|
770
789
|
promisedIsTypeOfResults[i] = isTypeOfResult;
|
|
771
790
|
} else if (isTypeOfResult) {
|
|
772
|
-
return type;
|
|
791
|
+
return type.name;
|
|
773
792
|
}
|
|
774
793
|
}
|
|
775
794
|
}
|
|
@@ -778,7 +797,7 @@ export var defaultTypeResolver = function defaultTypeResolver(value, contextValu
|
|
|
778
797
|
return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) {
|
|
779
798
|
for (var _i9 = 0; _i9 < isTypeOfResults.length; _i9++) {
|
|
780
799
|
if (isTypeOfResults[_i9]) {
|
|
781
|
-
return possibleTypes[_i9];
|
|
800
|
+
return possibleTypes[_i9].name;
|
|
782
801
|
}
|
|
783
802
|
}
|
|
784
803
|
});
|
|
@@ -805,12 +824,12 @@ export var defaultFieldResolver = function defaultFieldResolver(source, args, co
|
|
|
805
824
|
};
|
|
806
825
|
/**
|
|
807
826
|
* This method looks up the field on the given type definition.
|
|
808
|
-
* It has special casing for the
|
|
809
|
-
* and __typename. __typename is special because
|
|
810
|
-
* queried as a field, even in situations where no
|
|
811
|
-
* are allowed, like on a Union. __schema
|
|
812
|
-
* added to the query type, but that would
|
|
813
|
-
* definitions, which would cause issues.
|
|
827
|
+
* It has special casing for the three introspection fields,
|
|
828
|
+
* __schema, __type and __typename. __typename is special because
|
|
829
|
+
* it can always be queried as a field, even in situations where no
|
|
830
|
+
* other fields are allowed, like on a Union. __schema and __type
|
|
831
|
+
* could get automatically added to the query type, but that would
|
|
832
|
+
* require mutating type definitions, which would cause issues.
|
|
814
833
|
*
|
|
815
834
|
* @internal
|
|
816
835
|
*/
|
package/execution/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ export { pathToArray as responsePathAsArray } from '../jsutils/Path';
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
execute,
|
|
5
|
+
executeSync,
|
|
5
6
|
defaultFieldResolver,
|
|
6
7
|
defaultTypeResolver,
|
|
7
8
|
ExecutionArgs,
|
|
8
9
|
ExecutionResult,
|
|
10
|
+
FormattedExecutionResult,
|
|
9
11
|
} from './execute';
|
|
10
12
|
|
|
11
13
|
export { getDirectiveValues } from './values';
|
package/execution/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "execute", {
|
|
|
15
15
|
return _execute.execute;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "executeSync", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _execute.executeSync;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "defaultFieldResolver", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -34,8 +40,8 @@ Object.defineProperty(exports, "getDirectiveValues", {
|
|
|
34
40
|
}
|
|
35
41
|
});
|
|
36
42
|
|
|
37
|
-
var _Path = require("../jsutils/Path");
|
|
43
|
+
var _Path = require("../jsutils/Path.js");
|
|
38
44
|
|
|
39
|
-
var _execute = require("./execute");
|
|
45
|
+
var _execute = require("./execute.js");
|
|
40
46
|
|
|
41
|
-
var _values = require("./values");
|
|
47
|
+
var _values = require("./values.js");
|
package/execution/index.js.flow
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
// @flow strict
|
|
2
|
-
|
|
3
2
|
export { pathToArray as responsePathAsArray } from '../jsutils/Path';
|
|
4
3
|
|
|
5
|
-
export {
|
|
6
|
-
|
|
4
|
+
export {
|
|
5
|
+
execute,
|
|
6
|
+
executeSync,
|
|
7
|
+
defaultFieldResolver,
|
|
8
|
+
defaultTypeResolver,
|
|
9
|
+
} from './execute';
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
ExecutionArgs,
|
|
13
|
+
ExecutionResult,
|
|
14
|
+
FormattedExecutionResult,
|
|
15
|
+
} from './execute';
|
|
7
16
|
|
|
8
17
|
export { getDirectiveValues } from './values';
|
package/execution/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { pathToArray as responsePathAsArray } from "../jsutils/Path.mjs";
|
|
2
|
-
export { execute, defaultFieldResolver, defaultTypeResolver } from "./execute.mjs";
|
|
2
|
+
export { execute, executeSync, defaultFieldResolver, defaultTypeResolver } from "./execute.mjs";
|
|
3
3
|
export { getDirectiveValues } from "./values.mjs";
|
package/execution/values.js
CHANGED
|
@@ -7,27 +7,27 @@ exports.getVariableValues = getVariableValues;
|
|
|
7
7
|
exports.getArgumentValues = getArgumentValues;
|
|
8
8
|
exports.getDirectiveValues = getDirectiveValues;
|
|
9
9
|
|
|
10
|
-
var _find = _interopRequireDefault(require("../polyfills/find"));
|
|
10
|
+
var _find = _interopRequireDefault(require("../polyfills/find.js"));
|
|
11
11
|
|
|
12
|
-
var _keyMap = _interopRequireDefault(require("../jsutils/keyMap"));
|
|
12
|
+
var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js"));
|
|
13
13
|
|
|
14
|
-
var _inspect = _interopRequireDefault(require("../jsutils/inspect"));
|
|
14
|
+
var _inspect = _interopRequireDefault(require("../jsutils/inspect.js"));
|
|
15
15
|
|
|
16
|
-
var _printPathArray = _interopRequireDefault(require("../jsutils/printPathArray"));
|
|
16
|
+
var _printPathArray = _interopRequireDefault(require("../jsutils/printPathArray.js"));
|
|
17
17
|
|
|
18
|
-
var _GraphQLError = require("../error/GraphQLError");
|
|
18
|
+
var _GraphQLError = require("../error/GraphQLError.js");
|
|
19
19
|
|
|
20
|
-
var _kinds = require("../language/kinds");
|
|
20
|
+
var _kinds = require("../language/kinds.js");
|
|
21
21
|
|
|
22
|
-
var _printer = require("../language/printer");
|
|
22
|
+
var _printer = require("../language/printer.js");
|
|
23
23
|
|
|
24
|
-
var _definition = require("../type/definition");
|
|
24
|
+
var _definition = require("../type/definition.js");
|
|
25
25
|
|
|
26
|
-
var _typeFromAST = require("../utilities/typeFromAST");
|
|
26
|
+
var _typeFromAST = require("../utilities/typeFromAST.js");
|
|
27
27
|
|
|
28
|
-
var _valueFromAST = require("../utilities/valueFromAST");
|
|
28
|
+
var _valueFromAST = require("../utilities/valueFromAST.js");
|
|
29
29
|
|
|
30
|
-
var _coerceInputValue = require("../utilities/coerceInputValue");
|
|
30
|
+
var _coerceInputValue = require("../utilities/coerceInputValue.js");
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
package/execution/values.js.flow
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
// @flow strict
|
|
2
|
-
|
|
3
2
|
import find from '../polyfills/find';
|
|
4
3
|
|
|
4
|
+
import type { ObjMap } from '../jsutils/ObjMap';
|
|
5
5
|
import keyMap from '../jsutils/keyMap';
|
|
6
6
|
import inspect from '../jsutils/inspect';
|
|
7
|
-
import { type ObjMap } from '../jsutils/ObjMap';
|
|
8
7
|
import printPathArray from '../jsutils/printPathArray';
|
|
9
8
|
|
|
10
9
|
import { GraphQLError } from '../error/GraphQLError';
|
|
11
10
|
|
|
11
|
+
import type {
|
|
12
|
+
FieldNode,
|
|
13
|
+
DirectiveNode,
|
|
14
|
+
VariableDefinitionNode,
|
|
15
|
+
} from '../language/ast';
|
|
12
16
|
import { Kind } from '../language/kinds';
|
|
13
17
|
import { print } from '../language/printer';
|
|
14
|
-
import {
|
|
15
|
-
type FieldNode,
|
|
16
|
-
type DirectiveNode,
|
|
17
|
-
type VariableDefinitionNode,
|
|
18
|
-
} from '../language/ast';
|
|
19
18
|
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
isInputType,
|
|
25
|
-
isNonNullType,
|
|
26
|
-
} from '../type/definition';
|
|
19
|
+
import type { GraphQLSchema } from '../type/schema';
|
|
20
|
+
import type { GraphQLField } from '../type/definition';
|
|
21
|
+
import type { GraphQLDirective } from '../type/directives';
|
|
22
|
+
import { isInputType, isNonNullType } from '../type/definition';
|
|
27
23
|
|
|
28
24
|
import { typeFromAST } from '../utilities/typeFromAST';
|
|
29
25
|
import { valueFromAST } from '../utilities/valueFromAST';
|
package/graphql.js
CHANGED
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.graphql = graphql;
|
|
7
7
|
exports.graphqlSync = graphqlSync;
|
|
8
8
|
|
|
9
|
-
var _isPromise = _interopRequireDefault(require("./jsutils/isPromise"));
|
|
9
|
+
var _isPromise = _interopRequireDefault(require("./jsutils/isPromise.js"));
|
|
10
10
|
|
|
11
|
-
var _parser = require("./language/parser");
|
|
11
|
+
var _parser = require("./language/parser.js");
|
|
12
12
|
|
|
13
|
-
var _validate = require("./validation/validate");
|
|
13
|
+
var _validate = require("./validation/validate.js");
|
|
14
14
|
|
|
15
|
-
var _validate2 = require("./type/validate");
|
|
15
|
+
var _validate2 = require("./type/validate.js");
|
|
16
16
|
|
|
17
|
-
var _execute = require("./execution/execute");
|
|
17
|
+
var _execute = require("./execution/execute.js");
|
|
18
18
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
|
package/graphql.js.flow
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// @flow strict
|
|
2
|
-
|
|
2
|
+
import type { PromiseOrValue } from './jsutils/PromiseOrValue';
|
|
3
3
|
import isPromise from './jsutils/isPromise';
|
|
4
|
-
import { type PromiseOrValue } from './jsutils/PromiseOrValue';
|
|
5
4
|
|
|
5
|
+
import type { Source } from './language/source';
|
|
6
6
|
import { parse } from './language/parser';
|
|
7
|
-
import { type Source } from './language/source';
|
|
8
7
|
|
|
9
8
|
import { validate } from './validation/validate';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type GraphQLFieldResolver,
|
|
15
|
-
type GraphQLTypeResolver,
|
|
10
|
+
import type {
|
|
11
|
+
GraphQLFieldResolver,
|
|
12
|
+
GraphQLTypeResolver,
|
|
16
13
|
} from './type/definition';
|
|
14
|
+
import type { GraphQLSchema } from './type/schema';
|
|
15
|
+
import { validateSchema } from './type/validate';
|
|
17
16
|
|
|
18
|
-
import {
|
|
17
|
+
import type { ExecutionResult } from './execution/execute';
|
|
18
|
+
import { execute } from './execution/execute';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* This is the primary entry point function for fulfilling GraphQL operations
|
package/index.d.ts
CHANGED
|
@@ -139,32 +139,44 @@ export {
|
|
|
139
139
|
GraphQLNamedType,
|
|
140
140
|
Thunk,
|
|
141
141
|
GraphQLSchemaConfig,
|
|
142
|
+
GraphQLSchemaExtensions,
|
|
142
143
|
GraphQLDirectiveConfig,
|
|
144
|
+
GraphQLDirectiveExtensions,
|
|
143
145
|
GraphQLArgument,
|
|
144
146
|
GraphQLArgumentConfig,
|
|
147
|
+
GraphQLArgumentExtensions,
|
|
145
148
|
GraphQLEnumTypeConfig,
|
|
149
|
+
GraphQLEnumTypeExtensions,
|
|
146
150
|
GraphQLEnumValue,
|
|
147
151
|
GraphQLEnumValueConfig,
|
|
152
|
+
GraphQLEnumValueExtensions,
|
|
148
153
|
GraphQLEnumValueConfigMap,
|
|
149
154
|
GraphQLField,
|
|
150
155
|
GraphQLFieldConfig,
|
|
156
|
+
GraphQLFieldExtensions,
|
|
151
157
|
GraphQLFieldConfigArgumentMap,
|
|
152
158
|
GraphQLFieldConfigMap,
|
|
153
159
|
GraphQLFieldMap,
|
|
154
160
|
GraphQLFieldResolver,
|
|
155
161
|
GraphQLInputField,
|
|
156
162
|
GraphQLInputFieldConfig,
|
|
163
|
+
GraphQLInputFieldExtensions,
|
|
157
164
|
GraphQLInputFieldConfigMap,
|
|
158
165
|
GraphQLInputFieldMap,
|
|
159
166
|
GraphQLInputObjectTypeConfig,
|
|
167
|
+
GraphQLInputObjectTypeExtensions,
|
|
160
168
|
GraphQLInterfaceTypeConfig,
|
|
169
|
+
GraphQLInterfaceTypeExtensions,
|
|
161
170
|
GraphQLIsTypeOfFn,
|
|
162
171
|
GraphQLObjectTypeConfig,
|
|
172
|
+
GraphQLObjectTypeExtensions,
|
|
163
173
|
GraphQLResolveInfo,
|
|
164
174
|
ResponsePath,
|
|
165
175
|
GraphQLScalarTypeConfig,
|
|
176
|
+
GraphQLScalarTypeExtensions,
|
|
166
177
|
GraphQLTypeResolver,
|
|
167
178
|
GraphQLUnionTypeConfig,
|
|
179
|
+
GraphQLUnionTypeExtensions,
|
|
168
180
|
GraphQLScalarSerializer,
|
|
169
181
|
GraphQLScalarValueParser,
|
|
170
182
|
GraphQLScalarLiteralParser,
|
|
@@ -280,12 +292,14 @@ export {
|
|
|
280
292
|
// Execute GraphQL queries.
|
|
281
293
|
export {
|
|
282
294
|
execute,
|
|
295
|
+
executeSync,
|
|
283
296
|
defaultFieldResolver,
|
|
284
297
|
defaultTypeResolver,
|
|
285
298
|
responsePathAsArray,
|
|
286
299
|
getDirectiveValues,
|
|
287
300
|
ExecutionArgs,
|
|
288
301
|
ExecutionResult,
|
|
302
|
+
FormattedExecutionResult,
|
|
289
303
|
} from './execution/index';
|
|
290
304
|
|
|
291
305
|
export {
|
|
@@ -335,6 +349,9 @@ export {
|
|
|
335
349
|
UniqueFieldDefinitionNamesRule,
|
|
336
350
|
UniqueDirectiveNamesRule,
|
|
337
351
|
PossibleTypeExtensionsRule,
|
|
352
|
+
// Custom validation rules
|
|
353
|
+
NoDeprecatedCustomRule,
|
|
354
|
+
NoSchemaIntrospectionCustomRule,
|
|
338
355
|
ValidationRule,
|
|
339
356
|
} from './validation/index';
|
|
340
357
|
|
|
@@ -414,7 +431,7 @@ export {
|
|
|
414
431
|
DangerousChangeType,
|
|
415
432
|
findBreakingChanges,
|
|
416
433
|
findDangerousChanges,
|
|
417
|
-
// Report all deprecated usage within a GraphQL document.
|
|
434
|
+
// @deprecated: Report all deprecated usage within a GraphQL document.
|
|
418
435
|
findDeprecatedUsages,
|
|
419
436
|
} from './utilities/index';
|
|
420
437
|
|
|
@@ -444,4 +461,5 @@ export {
|
|
|
444
461
|
BuildSchemaOptions,
|
|
445
462
|
BreakingChange,
|
|
446
463
|
DangerousChange,
|
|
464
|
+
TypedQueryDocumentNode,
|
|
447
465
|
} from './utilities/index';
|
package/index.js
CHANGED
|
@@ -687,6 +687,12 @@ Object.defineProperty(exports, "execute", {
|
|
|
687
687
|
return _index3.execute;
|
|
688
688
|
}
|
|
689
689
|
});
|
|
690
|
+
Object.defineProperty(exports, "executeSync", {
|
|
691
|
+
enumerable: true,
|
|
692
|
+
get: function get() {
|
|
693
|
+
return _index3.executeSync;
|
|
694
|
+
}
|
|
695
|
+
});
|
|
690
696
|
Object.defineProperty(exports, "defaultFieldResolver", {
|
|
691
697
|
enumerable: true,
|
|
692
698
|
get: function get() {
|
|
@@ -939,6 +945,18 @@ Object.defineProperty(exports, "PossibleTypeExtensionsRule", {
|
|
|
939
945
|
return _index5.PossibleTypeExtensionsRule;
|
|
940
946
|
}
|
|
941
947
|
});
|
|
948
|
+
Object.defineProperty(exports, "NoDeprecatedCustomRule", {
|
|
949
|
+
enumerable: true,
|
|
950
|
+
get: function get() {
|
|
951
|
+
return _index5.NoDeprecatedCustomRule;
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", {
|
|
955
|
+
enumerable: true,
|
|
956
|
+
get: function get() {
|
|
957
|
+
return _index5.NoSchemaIntrospectionCustomRule;
|
|
958
|
+
}
|
|
959
|
+
});
|
|
942
960
|
Object.defineProperty(exports, "GraphQLError", {
|
|
943
961
|
enumerable: true,
|
|
944
962
|
get: function get() {
|
|
@@ -1168,20 +1186,20 @@ Object.defineProperty(exports, "findDeprecatedUsages", {
|
|
|
1168
1186
|
}
|
|
1169
1187
|
});
|
|
1170
1188
|
|
|
1171
|
-
var _version = require("./version");
|
|
1189
|
+
var _version = require("./version.js");
|
|
1172
1190
|
|
|
1173
|
-
var _graphql = require("./graphql");
|
|
1191
|
+
var _graphql = require("./graphql.js");
|
|
1174
1192
|
|
|
1175
|
-
var _index = require("./type/index");
|
|
1193
|
+
var _index = require("./type/index.js");
|
|
1176
1194
|
|
|
1177
|
-
var _index2 = require("./language/index");
|
|
1195
|
+
var _index2 = require("./language/index.js");
|
|
1178
1196
|
|
|
1179
|
-
var _index3 = require("./execution/index");
|
|
1197
|
+
var _index3 = require("./execution/index.js");
|
|
1180
1198
|
|
|
1181
|
-
var _index4 = require("./subscription/index");
|
|
1199
|
+
var _index4 = require("./subscription/index.js");
|
|
1182
1200
|
|
|
1183
|
-
var _index5 = require("./validation/index");
|
|
1201
|
+
var _index5 = require("./validation/index.js");
|
|
1184
1202
|
|
|
1185
|
-
var _index6 = require("./error/index");
|
|
1203
|
+
var _index6 = require("./error/index.js");
|
|
1186
1204
|
|
|
1187
|
-
var _index7 = require("./utilities/index");
|
|
1205
|
+
var _index7 = require("./utilities/index.js");
|