@@ -688,6 +688,7 @@ function executeField(
688
688
path : Path ,
689
689
asyncPayloadRecord ?: AsyncPayloadRecord ,
690
690
) : PromiseOrValue < unknown > {
691
+ const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
691
692
const fieldName = fieldNodes [ 0 ] . name . value ;
692
693
const fieldDef = exeContext . schema . getField ( parentType , fieldName ) ;
693
694
if ( ! fieldDef ) {
@@ -747,7 +748,6 @@ function executeField(
747
748
748
749
if ( isPromise ( completed ) ) {
749
750
return catchAfter ( completed , ( rawError ) => {
750
- const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
751
751
const error = locatedError ( rawError , fieldNodes , pathToArray ( path ) ) ;
752
752
const handledError = handleFieldError ( error , returnType , errors ) ;
753
753
filterSubsequentPayloads ( exeContext , path , asyncPayloadRecord ) ;
@@ -756,7 +756,6 @@ function executeField(
756
756
}
757
757
return completed ;
758
758
} catch ( rawError ) {
759
- const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
760
759
const error = locatedError ( rawError , fieldNodes , pathToArray ( path ) ) ;
761
760
const handledError = handleFieldError ( error , returnType , errors ) ;
762
761
filterSubsequentPayloads ( exeContext , path , asyncPayloadRecord ) ;
0 commit comments