@graphitation/supermassive 3.15.0 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +10 -2
- package/lib/executeWithoutSchema.d.ts.map +1 -1
- package/lib/executeWithoutSchema.js +40 -11
- package/lib/executeWithoutSchema.js.map +2 -2
- package/lib/executeWithoutSchema.mjs +40 -11
- package/lib/executeWithoutSchema.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -356,7 +356,13 @@ function executeField(exeContext, parentTypeName, source, fieldGroup, path, incr
|
|
|
356
356
|
fieldName
|
|
357
357
|
});
|
|
358
358
|
if (!loading) {
|
|
359
|
-
|
|
359
|
+
handleMissingSchemaError(
|
|
360
|
+
exeContext,
|
|
361
|
+
void 0,
|
|
362
|
+
fieldGroup,
|
|
363
|
+
path,
|
|
364
|
+
incrementalDataRecord
|
|
365
|
+
);
|
|
360
366
|
return void 0;
|
|
361
367
|
}
|
|
362
368
|
return loading.then(() => {
|
|
@@ -376,17 +382,16 @@ function executeField(exeContext, parentTypeName, source, fieldGroup, path, incr
|
|
|
376
382
|
incrementalDataRecord
|
|
377
383
|
);
|
|
378
384
|
}
|
|
379
|
-
|
|
385
|
+
handleMissingSchemaError(
|
|
386
|
+
exeContext,
|
|
387
|
+
void 0,
|
|
388
|
+
fieldGroup,
|
|
389
|
+
path,
|
|
390
|
+
incrementalDataRecord
|
|
391
|
+
);
|
|
380
392
|
return void 0;
|
|
381
393
|
});
|
|
382
394
|
}
|
|
383
|
-
function throwIfRootField(parentTypeName, fieldName, fieldGroup, validationTarget) {
|
|
384
|
-
const isRootField = parentTypeName === "Mutation" || parentTypeName === "Query";
|
|
385
|
-
if (isRootField) {
|
|
386
|
-
const message = validationTarget === "typeDefinition" ? `Type definition for ${parentTypeName}.${fieldName} is missing` : validationTarget === "resolver" ? `Resolver for ${parentTypeName}.${fieldName} is missing` : "Unexpected validation target";
|
|
387
|
-
throw locatedError(new Error(message), fieldGroup);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
395
|
function requestSchemaFragment(exeContext, request) {
|
|
391
396
|
if (!exeContext.schemaFragmentLoader) {
|
|
392
397
|
return;
|
|
@@ -620,12 +625,30 @@ function buildResolveInfo(exeContext, fieldName, fieldGroup, parentTypeName, ret
|
|
|
620
625
|
function handleFieldError(rawError, exeContext, returnTypeRef, fieldGroup, path, incrementalDataRecord) {
|
|
621
626
|
var _a;
|
|
622
627
|
const error = locatedError(rawError, fieldGroup, pathToArray(path));
|
|
623
|
-
if (isNonNullType(returnTypeRef)) {
|
|
628
|
+
if (returnTypeRef && isNonNullType(returnTypeRef)) {
|
|
624
629
|
throw error;
|
|
625
630
|
}
|
|
626
631
|
const errors = (_a = incrementalDataRecord == null ? void 0 : incrementalDataRecord.errors) != null ? _a : exeContext.errors;
|
|
627
632
|
errors.push(error);
|
|
628
633
|
}
|
|
634
|
+
function handleMissingSchemaError(exeContext, returnTypeRef, fieldGroup, path, incrementalDataRecord) {
|
|
635
|
+
const parentTypeName = path.typename;
|
|
636
|
+
const isRootField = parentTypeName === "Mutation" || parentTypeName === "Query";
|
|
637
|
+
if (!isRootField) {
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
const fieldName = path.key;
|
|
641
|
+
const message = !returnTypeRef ? `Type definition for ${parentTypeName}.${fieldName} is missing` : `Resolver for ${parentTypeName}.${fieldName} is missing`;
|
|
642
|
+
const error = new Error(message);
|
|
643
|
+
handleFieldError(
|
|
644
|
+
error,
|
|
645
|
+
exeContext,
|
|
646
|
+
returnTypeRef,
|
|
647
|
+
fieldGroup,
|
|
648
|
+
path,
|
|
649
|
+
incrementalDataRecord
|
|
650
|
+
);
|
|
651
|
+
}
|
|
629
652
|
function resolveAndCompleteField(exeContext, parentTypeName, fieldDefinition, fieldGroup, path, source, incrementalDataRecord) {
|
|
630
653
|
var _a;
|
|
631
654
|
const fieldName = fieldGroup[0].name.value;
|
|
@@ -645,7 +668,13 @@ function resolveAndCompleteField(exeContext, parentTypeName, fieldDefinition, fi
|
|
|
645
668
|
);
|
|
646
669
|
const isDefaultResolverUsed = resolveFn === exeContext.fieldResolver || fieldName === "__typename";
|
|
647
670
|
if (resolveFn === exeContext.fieldResolver && typeof source === "undefined") {
|
|
648
|
-
|
|
671
|
+
handleMissingSchemaError(
|
|
672
|
+
exeContext,
|
|
673
|
+
returnTypeRef,
|
|
674
|
+
fieldGroup,
|
|
675
|
+
path,
|
|
676
|
+
incrementalDataRecord
|
|
677
|
+
);
|
|
649
678
|
}
|
|
650
679
|
const hooks = exeContext.fieldExecutionHooks;
|
|
651
680
|
let hookContext = void 0;
|