Skip to content

Commit da0a5a4

Browse files
committed
reduce diff
1 parent 438b29a commit da0a5a4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/execution/execute.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ function executeField(
688688
path: Path,
689689
asyncPayloadRecord?: AsyncPayloadRecord,
690690
): PromiseOrValue<unknown> {
691+
const errors = asyncPayloadRecord?.errors ?? exeContext.errors;
691692
const fieldName = fieldNodes[0].name.value;
692693
const fieldDef = exeContext.schema.getField(parentType, fieldName);
693694
if (!fieldDef) {
@@ -747,7 +748,6 @@ function executeField(
747748

748749
if (isPromise(completed)) {
749750
return catchAfter(completed, (rawError) => {
750-
const errors = asyncPayloadRecord?.errors ?? exeContext.errors;
751751
const error = locatedError(rawError, fieldNodes, pathToArray(path));
752752
const handledError = handleFieldError(error, returnType, errors);
753753
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);
@@ -756,7 +756,6 @@ function executeField(
756756
}
757757
return completed;
758758
} catch (rawError) {
759-
const errors = asyncPayloadRecord?.errors ?? exeContext.errors;
760759
const error = locatedError(rawError, fieldNodes, pathToArray(path));
761760
const handledError = handleFieldError(error, returnType, errors);
762761
filterSubsequentPayloads(exeContext, path, asyncPayloadRecord);

0 commit comments

Comments
 (0)