@graphitation/supermassive 3.0.0-alpha.5 → 3.0.0-alpha.7
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/.eslintcache +1 -1
- package/CHANGELOG.md +18 -2
- package/lib/benchmarks/index.js.map +2 -2
- package/lib/benchmarks/index.mjs.map +2 -2
- package/lib/collectFields.d.ts.map +1 -1
- package/lib/collectFields.js +6 -5
- package/lib/collectFields.js.map +2 -2
- package/lib/collectFields.mjs +6 -5
- package/lib/collectFields.mjs.map +2 -2
- package/lib/executeWithoutSchema.d.ts +1 -3
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +153 -69
- package/lib/executeWithoutSchema.js.map +2 -2
- package/lib/executeWithoutSchema.mjs +143 -71
- package/lib/executeWithoutSchema.mjs.map +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +2 -2
- package/lib/index.mjs +10 -2
- package/lib/index.mjs.map +2 -2
- package/lib/schema/definition.d.ts +43 -33
- package/lib/schema/definition.d.ts.map +1 -1
- package/lib/schema/definition.js +284 -9
- package/lib/schema/definition.js.map +2 -2
- package/lib/schema/definition.mjs +284 -55
- package/lib/schema/definition.mjs.map +3 -3
- package/lib/schema/directives.d.ts.map +1 -1
- package/lib/schema/directives.js +3 -3
- package/lib/schema/directives.js.map +2 -2
- package/lib/schema/directives.mjs +4 -4
- package/lib/schema/directives.mjs.map +2 -2
- package/lib/schema/reference.d.ts +3 -1
- package/lib/schema/reference.d.ts.map +1 -1
- package/lib/schema/reference.js.map +2 -2
- package/lib/schema/reference.mjs.map +2 -2
- package/lib/schema/resolvers.d.ts +10 -4
- package/lib/schema/resolvers.d.ts.map +1 -1
- package/lib/schema/resolvers.js +92 -9
- package/lib/schema/resolvers.js.map +2 -2
- package/lib/schema/resolvers.mjs +99 -9
- package/lib/schema/resolvers.mjs.map +2 -2
- package/lib/types.d.ts +25 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utilities/coerceInputValue.d.ts +3 -3
- package/lib/utilities/coerceInputValue.d.ts.map +1 -1
- package/lib/utilities/coerceInputValue.js +17 -12
- package/lib/utilities/coerceInputValue.js.map +2 -2
- package/lib/utilities/coerceInputValue.mjs +22 -12
- package/lib/utilities/coerceInputValue.mjs.map +2 -2
- package/lib/utilities/decodeASTSchema.d.ts.map +1 -1
- package/lib/utilities/decodeASTSchema.js +32 -40
- package/lib/utilities/decodeASTSchema.js.map +2 -2
- package/lib/utilities/decodeASTSchema.mjs +51 -49
- package/lib/utilities/decodeASTSchema.mjs.map +2 -2
- package/lib/utilities/encodeASTSchema.d.ts.map +1 -1
- package/lib/utilities/encodeASTSchema.js +16 -20
- package/lib/utilities/encodeASTSchema.js.map +2 -2
- package/lib/utilities/encodeASTSchema.mjs +22 -21
- package/lib/utilities/encodeASTSchema.mjs.map +2 -2
- package/lib/utilities/extractMinimalViableSchemaForRequestDocument.d.ts.map +1 -1
- package/lib/utilities/extractMinimalViableSchemaForRequestDocument.js +20 -22
- package/lib/utilities/extractMinimalViableSchemaForRequestDocument.js.map +2 -2
- package/lib/utilities/extractMinimalViableSchemaForRequestDocument.mjs +35 -29
- package/lib/utilities/extractMinimalViableSchemaForRequestDocument.mjs.map +2 -2
- package/lib/utilities/mergeResolvers.js +1 -2
- package/lib/utilities/mergeResolvers.js.map +2 -2
- package/lib/utilities/mergeResolvers.mjs +1 -2
- package/lib/utilities/mergeResolvers.mjs.map +2 -2
- package/lib/utilities/mergeSchemaDefinitions.d.ts.map +1 -1
- package/lib/utilities/mergeSchemaDefinitions.js +18 -28
- package/lib/utilities/mergeSchemaDefinitions.js.map +2 -2
- package/lib/utilities/mergeSchemaDefinitions.mjs +28 -34
- package/lib/utilities/mergeSchemaDefinitions.mjs.map +2 -2
- package/lib/utilities/valueFromAST.d.ts +3 -3
- package/lib/utilities/valueFromAST.d.ts.map +1 -1
- package/lib/utilities/valueFromAST.js +23 -10
- package/lib/utilities/valueFromAST.js.map +2 -2
- package/lib/utilities/valueFromAST.mjs +13 -10
- package/lib/utilities/valueFromAST.mjs.map +2 -2
- package/lib/values.d.ts +2 -2
- package/lib/values.d.ts.map +1 -1
- package/lib/values.js +14 -14
- package/lib/values.js.map +2 -2
- package/lib/values.mjs +21 -14
- package/lib/values.mjs.map +2 -2
- package/package.json +1 -1
- package/lib/schema/fragment.d.ts +0 -63
- package/lib/schema/fragment.d.ts.map +0 -1
- package/lib/schema/fragment.js +0 -295
- package/lib/schema/fragment.js.map +0 -7
- package/lib/schema/fragment.mjs +0 -292
- package/lib/schema/fragment.mjs.map +0 -7
|
@@ -67,9 +67,6 @@ import { isAsyncIterable } from "./jsutils/isAsyncIterable.mjs";
|
|
|
67
67
|
import { mapAsyncIterator } from "./utilities/mapAsyncIterator.mjs";
|
|
68
68
|
import { GraphQLStreamDirective } from "./schema/directives.mjs";
|
|
69
69
|
import { memoize3 } from "./jsutils/memoize3.mjs";
|
|
70
|
-
import {
|
|
71
|
-
PartialSchema
|
|
72
|
-
} from "./schema/fragment.mjs";
|
|
73
70
|
import {
|
|
74
71
|
inspectTypeReference,
|
|
75
72
|
isListType,
|
|
@@ -77,12 +74,14 @@ import {
|
|
|
77
74
|
typeNameFromReference,
|
|
78
75
|
unwrap
|
|
79
76
|
} from "./schema/reference.mjs";
|
|
77
|
+
import * as Definitions from "./schema/definition.mjs";
|
|
78
|
+
import * as Resolvers from "./schema/resolvers.mjs";
|
|
80
79
|
var collectSubfields = memoize3(
|
|
81
80
|
(exeContext, returnTypeName, fieldGroup) => _collectSubfields(exeContext, returnTypeName.name, fieldGroup)
|
|
82
81
|
);
|
|
83
82
|
function executeWithoutSchema(args) {
|
|
84
83
|
const exeContext = buildExecutionContext(args);
|
|
85
|
-
if (!("
|
|
84
|
+
if (!("schemaFragment" in exeContext)) {
|
|
86
85
|
return { errors: exeContext };
|
|
87
86
|
} else {
|
|
88
87
|
return executeOperation(exeContext);
|
|
@@ -98,7 +97,6 @@ function assertValidExecutionArguments(document, rawVariableValues) {
|
|
|
98
97
|
function buildExecutionContext(args) {
|
|
99
98
|
var _a, _b;
|
|
100
99
|
const {
|
|
101
|
-
// resolvers,
|
|
102
100
|
schemaFragment,
|
|
103
101
|
schemaFragmentLoader,
|
|
104
102
|
document,
|
|
@@ -143,9 +141,8 @@ function buildExecutionContext(args) {
|
|
|
143
141
|
return [new GraphQLError("Must provide an operation.")];
|
|
144
142
|
}
|
|
145
143
|
const variableDefinitions = (_b = operation.variableDefinitions) != null ? _b : [];
|
|
146
|
-
const partialSchema = new PartialSchema(schemaFragment);
|
|
147
144
|
const coercedVariableValues = getVariableValues(
|
|
148
|
-
|
|
145
|
+
schemaFragment,
|
|
149
146
|
variableDefinitions,
|
|
150
147
|
variableValues != null ? variableValues : {},
|
|
151
148
|
{ maxErrors: 50 }
|
|
@@ -154,7 +151,6 @@ function buildExecutionContext(args) {
|
|
|
154
151
|
return coercedVariableValues.errors;
|
|
155
152
|
}
|
|
156
153
|
return {
|
|
157
|
-
partialSchema,
|
|
158
154
|
schemaFragment,
|
|
159
155
|
schemaFragmentLoader,
|
|
160
156
|
fragments,
|
|
@@ -318,8 +314,13 @@ function executeFields(exeContext, parentTypeName, sourceValue, path, groupedFie
|
|
|
318
314
|
return promiseForObject(results);
|
|
319
315
|
}
|
|
320
316
|
function executeField(exeContext, parentTypeName, source, fieldGroup, path, incrementalDataRecord) {
|
|
317
|
+
const schemaFragment = exeContext.schemaFragment;
|
|
321
318
|
const fieldName = fieldGroup[0].name.value;
|
|
322
|
-
const fieldDef =
|
|
319
|
+
const fieldDef = Definitions.getField(
|
|
320
|
+
schemaFragment.definitions,
|
|
321
|
+
parentTypeName,
|
|
322
|
+
fieldName
|
|
323
|
+
);
|
|
323
324
|
if (fieldDef !== void 0) {
|
|
324
325
|
return resolveAndCompleteField(
|
|
325
326
|
exeContext,
|
|
@@ -331,30 +332,50 @@ function executeField(exeContext, parentTypeName, source, fieldGroup, path, incr
|
|
|
331
332
|
incrementalDataRecord
|
|
332
333
|
);
|
|
333
334
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
return exeContext.schemaFragmentLoader(exeContext.schemaFragment, exeContext.contextValue, {
|
|
338
|
-
kind: "byField",
|
|
335
|
+
const loading = requestSchemaFragment(exeContext, {
|
|
336
|
+
kind: "ReturnType",
|
|
339
337
|
parentTypeName,
|
|
340
338
|
fieldName
|
|
341
|
-
})
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
339
|
+
});
|
|
340
|
+
if (!loading) {
|
|
341
|
+
return void 0;
|
|
342
|
+
}
|
|
343
|
+
return loading.then(() => {
|
|
344
|
+
const fieldDef2 = Definitions.getField(
|
|
345
|
+
exeContext.schemaFragment.definitions,
|
|
346
346
|
parentTypeName,
|
|
347
347
|
fieldName
|
|
348
348
|
);
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
349
|
+
if (fieldDef2 !== void 0) {
|
|
350
|
+
return resolveAndCompleteField(
|
|
351
|
+
exeContext,
|
|
352
|
+
parentTypeName,
|
|
353
|
+
fieldDef2,
|
|
354
|
+
fieldGroup,
|
|
355
|
+
path,
|
|
356
|
+
source,
|
|
357
|
+
incrementalDataRecord
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
return void 0;
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function requestSchemaFragment(exeContext, request) {
|
|
364
|
+
if (!exeContext.schemaFragmentLoader) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
return exeContext.schemaFragmentLoader(
|
|
368
|
+
exeContext.schemaFragment,
|
|
369
|
+
exeContext.contextValue,
|
|
370
|
+
request
|
|
371
|
+
).then(({ mergedFragment, mergedContextValue }) => {
|
|
372
|
+
if (exeContext.schemaFragment.schemaId !== mergedFragment.schemaId) {
|
|
373
|
+
throw new Error(
|
|
374
|
+
`Cannot use new schema fragment: old and new fragments describe different schemas: ${exeContext.schemaFragment.schemaId} vs. ${mergedFragment.schemaId}`
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
exeContext.contextValue = mergedContextValue != null ? mergedContextValue : exeContext.contextValue;
|
|
378
|
+
exeContext.schemaFragment = mergedFragment;
|
|
358
379
|
});
|
|
359
380
|
}
|
|
360
381
|
function createSourceEventStream(exeContext) {
|
|
@@ -370,21 +391,29 @@ function createSourceEventStream(exeContext) {
|
|
|
370
391
|
}
|
|
371
392
|
function executeSubscriptionImpl(exeContext) {
|
|
372
393
|
var _a;
|
|
373
|
-
const { operation, rootValue,
|
|
394
|
+
const { operation, rootValue, schemaFragment } = exeContext;
|
|
374
395
|
const rootTypeName = getOperationRootTypeName(operation);
|
|
375
396
|
const { groupedFieldSet } = collectFields(exeContext, rootTypeName);
|
|
376
397
|
const firstRootField = groupedFieldSet.entries().next().value;
|
|
377
398
|
const [responseName, fieldGroup] = firstRootField;
|
|
378
399
|
const fieldName = fieldGroup[0].name.value;
|
|
379
|
-
const fieldDef =
|
|
400
|
+
const fieldDef = Definitions.getField(
|
|
401
|
+
schemaFragment.definitions,
|
|
402
|
+
rootTypeName,
|
|
403
|
+
fieldName
|
|
404
|
+
);
|
|
380
405
|
if (!fieldDef) {
|
|
381
406
|
throw new GraphQLError(
|
|
382
407
|
`The subscription field "${fieldName}" is not defined.`,
|
|
383
408
|
{ nodes: fieldGroup }
|
|
384
409
|
);
|
|
385
410
|
}
|
|
386
|
-
const returnTypeRef =
|
|
387
|
-
const resolveFn = (_a =
|
|
411
|
+
const returnTypeRef = Definitions.getFieldTypeReference(fieldDef);
|
|
412
|
+
const resolveFn = (_a = Resolvers.getSubscriptionFieldResolver(
|
|
413
|
+
schemaFragment,
|
|
414
|
+
rootTypeName,
|
|
415
|
+
fieldName
|
|
416
|
+
)) != null ? _a : exeContext.subscribeFieldResolver;
|
|
388
417
|
const path = addPath(void 0, responseName, rootTypeName);
|
|
389
418
|
const info = buildResolveInfo(
|
|
390
419
|
exeContext,
|
|
@@ -478,8 +507,12 @@ function handleFieldError(rawError, exeContext, returnTypeRef, fieldGroup, path,
|
|
|
478
507
|
function resolveAndCompleteField(exeContext, parentTypeName, fieldDefinition, fieldGroup, path, source, incrementalDataRecord) {
|
|
479
508
|
var _a;
|
|
480
509
|
const fieldName = fieldGroup[0].name.value;
|
|
481
|
-
const returnTypeRef =
|
|
482
|
-
const resolveFn = (_a =
|
|
510
|
+
const returnTypeRef = Definitions.getFieldTypeReference(fieldDefinition);
|
|
511
|
+
const resolveFn = (_a = Resolvers.getFieldResolver(
|
|
512
|
+
exeContext.schemaFragment,
|
|
513
|
+
parentTypeName,
|
|
514
|
+
fieldName
|
|
515
|
+
)) != null ? _a : exeContext.fieldResolver;
|
|
483
516
|
const info = buildResolveInfo(
|
|
484
517
|
exeContext,
|
|
485
518
|
fieldName,
|
|
@@ -619,13 +652,13 @@ function completeValue(exeContext, returnTypeRef, fieldGroup, info, path, result
|
|
|
619
652
|
incrementalDataRecord
|
|
620
653
|
);
|
|
621
654
|
}
|
|
622
|
-
const
|
|
655
|
+
const { schemaFragment } = exeContext;
|
|
623
656
|
const returnTypeName = typeNameFromReference(returnTypeRef);
|
|
624
|
-
const leafType =
|
|
657
|
+
const leafType = Resolvers.getLeafTypeResolver(schemaFragment, returnTypeRef);
|
|
625
658
|
if (leafType) {
|
|
626
659
|
return completeLeafValue(leafType, result);
|
|
627
660
|
}
|
|
628
|
-
if (
|
|
661
|
+
if (Definitions.isAbstractType(schemaFragment.definitions, returnTypeRef)) {
|
|
629
662
|
return completeAbstractValue(
|
|
630
663
|
exeContext,
|
|
631
664
|
returnTypeName,
|
|
@@ -636,7 +669,7 @@ function completeValue(exeContext, returnTypeRef, fieldGroup, info, path, result
|
|
|
636
669
|
incrementalDataRecord
|
|
637
670
|
);
|
|
638
671
|
}
|
|
639
|
-
if (
|
|
672
|
+
if (Definitions.isObjectType(schemaFragment.definitions, returnTypeRef)) {
|
|
640
673
|
return completeObjectValue(
|
|
641
674
|
exeContext,
|
|
642
675
|
returnTypeName,
|
|
@@ -887,21 +920,32 @@ function completeLeafValue(returnType, result) {
|
|
|
887
920
|
}
|
|
888
921
|
function completeAbstractValue(exeContext, returnTypeName, fieldGroup, info, path, result, incrementalDataRecord) {
|
|
889
922
|
var _a;
|
|
890
|
-
const
|
|
923
|
+
const { schemaFragment } = exeContext;
|
|
924
|
+
const resolveTypeFn = (_a = Resolvers.getAbstractTypeResolver(schemaFragment, returnTypeName)) != null ? _a : exeContext.typeResolver;
|
|
891
925
|
const contextValue = exeContext.contextValue;
|
|
892
926
|
const runtimeTypeName = resolveTypeFn(result, contextValue, info);
|
|
893
|
-
|
|
894
|
-
|
|
927
|
+
const validatedRuntimeTypeName = isPromise(runtimeTypeName) ? runtimeTypeName.then(
|
|
928
|
+
(resolvedRuntimeTypeName) => ensureValidRuntimeType(
|
|
929
|
+
resolvedRuntimeTypeName,
|
|
930
|
+
exeContext,
|
|
931
|
+
returnTypeName,
|
|
932
|
+
fieldGroup,
|
|
933
|
+
info,
|
|
934
|
+
result
|
|
935
|
+
)
|
|
936
|
+
) : ensureValidRuntimeType(
|
|
937
|
+
runtimeTypeName,
|
|
938
|
+
exeContext,
|
|
939
|
+
returnTypeName,
|
|
940
|
+
fieldGroup,
|
|
941
|
+
info,
|
|
942
|
+
result
|
|
943
|
+
);
|
|
944
|
+
if (isPromise(validatedRuntimeTypeName)) {
|
|
945
|
+
return validatedRuntimeTypeName.then(
|
|
895
946
|
(resolvedRuntimeTypeName) => completeObjectValue(
|
|
896
947
|
exeContext,
|
|
897
|
-
|
|
898
|
-
resolvedRuntimeTypeName,
|
|
899
|
-
exeContext,
|
|
900
|
-
returnTypeName,
|
|
901
|
-
fieldGroup,
|
|
902
|
-
info,
|
|
903
|
-
result
|
|
904
|
-
),
|
|
948
|
+
resolvedRuntimeTypeName,
|
|
905
949
|
fieldGroup,
|
|
906
950
|
path,
|
|
907
951
|
result,
|
|
@@ -911,14 +955,7 @@ function completeAbstractValue(exeContext, returnTypeName, fieldGroup, info, pat
|
|
|
911
955
|
}
|
|
912
956
|
return completeObjectValue(
|
|
913
957
|
exeContext,
|
|
914
|
-
|
|
915
|
-
runtimeTypeName,
|
|
916
|
-
exeContext,
|
|
917
|
-
returnTypeName,
|
|
918
|
-
fieldGroup,
|
|
919
|
-
info,
|
|
920
|
-
result
|
|
921
|
-
),
|
|
958
|
+
validatedRuntimeTypeName,
|
|
922
959
|
fieldGroup,
|
|
923
960
|
path,
|
|
924
961
|
result,
|
|
@@ -937,37 +974,72 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnTypeName, fie
|
|
|
937
974
|
`Abstract type "${returnTypeName}" must resolve to an Object type at runtime for field "${info.returnTypeName}.${info.fieldName}" with value ${inspect(result)}, received "${inspect(runtimeTypeName)}".`
|
|
938
975
|
);
|
|
939
976
|
}
|
|
940
|
-
const
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
|
|
977
|
+
const strictInterfaceValidation = !!exeContext.schemaFragmentLoader;
|
|
978
|
+
const isDefinedType = Definitions.isDefined(
|
|
979
|
+
exeContext.schemaFragment.definitions,
|
|
980
|
+
runtimeTypeName
|
|
981
|
+
);
|
|
982
|
+
const loading = !isDefinedType ? requestSchemaFragment(exeContext, {
|
|
983
|
+
kind: "RuntimeType",
|
|
984
|
+
abstractTypeName: returnTypeName,
|
|
985
|
+
runtimeTypeName
|
|
986
|
+
}) : void 0;
|
|
987
|
+
return loading ? loading.then(
|
|
988
|
+
() => ensureValidRuntimeTypeImpl(
|
|
989
|
+
runtimeTypeName,
|
|
990
|
+
exeContext,
|
|
991
|
+
returnTypeName,
|
|
992
|
+
fieldGroup,
|
|
993
|
+
strictInterfaceValidation
|
|
994
|
+
)
|
|
995
|
+
) : ensureValidRuntimeTypeImpl(
|
|
996
|
+
runtimeTypeName,
|
|
997
|
+
exeContext,
|
|
998
|
+
returnTypeName,
|
|
999
|
+
fieldGroup,
|
|
1000
|
+
strictInterfaceValidation
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
function ensureValidRuntimeTypeImpl(runtimeTypeName, exeContext, returnTypeName, fieldGroup, strictInterfaceValidation) {
|
|
1004
|
+
const definitions = exeContext.schemaFragment.definitions;
|
|
1005
|
+
const union = Definitions.getUnionType(definitions, returnTypeName);
|
|
1006
|
+
if (union || strictInterfaceValidation) {
|
|
1007
|
+
if (!Definitions.isDefined(definitions, runtimeTypeName)) {
|
|
944
1008
|
throw new GraphQLError(
|
|
945
|
-
`Abstract type "${returnTypeName}" was resolved to a
|
|
1009
|
+
`Abstract type "${returnTypeName}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`,
|
|
946
1010
|
{ nodes: fieldGroup }
|
|
947
1011
|
);
|
|
948
1012
|
}
|
|
949
|
-
|
|
950
|
-
} else {
|
|
951
|
-
if (!partialSchema.isDefined(runtimeTypeName)) {
|
|
1013
|
+
if (!Definitions.isObjectType(definitions, runtimeTypeName)) {
|
|
952
1014
|
throw new GraphQLError(
|
|
953
|
-
`Abstract type "${returnTypeName}" was resolved to a type "${runtimeTypeName}"
|
|
1015
|
+
`Abstract type "${returnTypeName}" was resolved to a non-object type "${runtimeTypeName}".`,
|
|
954
1016
|
{ nodes: fieldGroup }
|
|
955
1017
|
);
|
|
956
1018
|
}
|
|
957
|
-
if (!
|
|
1019
|
+
if (!Definitions.isSubType(definitions, returnTypeName, runtimeTypeName)) {
|
|
958
1020
|
throw new GraphQLError(
|
|
959
|
-
`
|
|
1021
|
+
`Runtime Object type "${runtimeTypeName}" is not a possible type for "${returnTypeName}".`,
|
|
960
1022
|
{ nodes: fieldGroup }
|
|
961
1023
|
);
|
|
962
1024
|
}
|
|
963
|
-
|
|
1025
|
+
return runtimeTypeName;
|
|
1026
|
+
}
|
|
1027
|
+
const iface = Definitions.getInterfaceType(definitions, returnTypeName);
|
|
1028
|
+
if (iface) {
|
|
1029
|
+
if (Definitions.isDefined(definitions, runtimeTypeName) && !Definitions.isObjectType(definitions, runtimeTypeName)) {
|
|
964
1030
|
throw new GraphQLError(
|
|
965
|
-
`
|
|
1031
|
+
`Abstract type "${returnTypeName}" was resolved to a non-object type "${runtimeTypeName}".`,
|
|
966
1032
|
{ nodes: fieldGroup }
|
|
967
1033
|
);
|
|
968
1034
|
}
|
|
1035
|
+
Definitions.addInterfaceImplementation(
|
|
1036
|
+
definitions,
|
|
1037
|
+
returnTypeName,
|
|
1038
|
+
runtimeTypeName
|
|
1039
|
+
);
|
|
1040
|
+
return runtimeTypeName;
|
|
969
1041
|
}
|
|
970
|
-
|
|
1042
|
+
invariant(false, `${returnTypeName} is not an abstract type`);
|
|
971
1043
|
}
|
|
972
1044
|
function completeObjectValue(exeContext, returnTypeName, fieldGroup, path, result, incrementalDataRecord) {
|
|
973
1045
|
return collectAndExecuteSubfields(
|