@graphitation/supermassive 3.15.1 → 3.15.2
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 +10 -2
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +43 -4
- package/lib/executeWithoutSchema.js.map +2 -2
- package/lib/executeWithoutSchema.mjs +43 -4
- package/lib/executeWithoutSchema.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -434,8 +434,7 @@ function afterFieldSubscribeHandle(resolved, isDefaultResolverUsed, exeContext,
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
function executeSubscriptionImpl(exeContext) {
|
|
437
|
-
|
|
438
|
-
const { operation, rootValue, schemaFragment } = exeContext;
|
|
437
|
+
const { operation, schemaFragment } = exeContext;
|
|
439
438
|
const rootTypeName = getOperationRootTypeName(operation);
|
|
440
439
|
const { groupedFieldSet } = collectFields(exeContext, rootTypeName);
|
|
441
440
|
const firstRootField = groupedFieldSet.entries().next().value;
|
|
@@ -449,12 +448,52 @@ function executeSubscriptionImpl(exeContext) {
|
|
|
449
448
|
rootTypeName,
|
|
450
449
|
fieldName
|
|
451
450
|
);
|
|
452
|
-
if (
|
|
451
|
+
if (fieldDef) {
|
|
452
|
+
return runSubscriptionResolver(
|
|
453
|
+
exeContext,
|
|
454
|
+
fieldDef,
|
|
455
|
+
fieldName,
|
|
456
|
+
fieldGroup,
|
|
457
|
+
responseName,
|
|
458
|
+
rootTypeName
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
const loading = requestSchemaFragment(exeContext, {
|
|
462
|
+
kind: "ReturnType",
|
|
463
|
+
parentTypeName: rootTypeName,
|
|
464
|
+
fieldName
|
|
465
|
+
});
|
|
466
|
+
if (!loading) {
|
|
453
467
|
throw locatedError(
|
|
454
|
-
`
|
|
468
|
+
`Type definition for ${rootTypeName}.${fieldName} is missing`,
|
|
455
469
|
fieldGroup
|
|
456
470
|
);
|
|
457
471
|
}
|
|
472
|
+
return loading.then(() => {
|
|
473
|
+
const fieldDef2 = Definitions.getField(
|
|
474
|
+
schemaFragment.definitions,
|
|
475
|
+
rootTypeName,
|
|
476
|
+
fieldName
|
|
477
|
+
);
|
|
478
|
+
if (fieldDef2 === void 0) {
|
|
479
|
+
throw locatedError(
|
|
480
|
+
`Type definition for ${rootTypeName}.${fieldName} is missing`,
|
|
481
|
+
fieldGroup
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
return runSubscriptionResolver(
|
|
485
|
+
exeContext,
|
|
486
|
+
fieldDef2,
|
|
487
|
+
fieldName,
|
|
488
|
+
fieldGroup,
|
|
489
|
+
responseName,
|
|
490
|
+
rootTypeName
|
|
491
|
+
);
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
function runSubscriptionResolver(exeContext, fieldDef, fieldName, fieldGroup, responseName, rootTypeName) {
|
|
495
|
+
var _a;
|
|
496
|
+
const { rootValue, schemaFragment } = exeContext;
|
|
458
497
|
const returnTypeRef = Definitions.getFieldTypeReference(fieldDef);
|
|
459
498
|
const resolveFn = (_a = Resolvers.getSubscriptionFieldResolver(
|
|
460
499
|
schemaFragment,
|