@@ -1025,7 +1025,6 @@ async function completeAsyncIteratorValue(
1025
1025
iterator : AsyncIterator < unknown > ,
1026
1026
asyncPayloadRecord ?: AsyncPayloadRecord ,
1027
1027
) : Promise < ReadonlyArray < unknown > > {
1028
- const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
1029
1028
const stream = getStreamValues ( exeContext , fieldNodes , path ) ;
1030
1029
let containsPromise = false ;
1031
1030
const completedResults : Array < unknown > = [ ] ;
@@ -1058,6 +1057,10 @@ async function completeAsyncIteratorValue(
1058
1057
// eslint-disable-next-line no-await-in-loop
1059
1058
iteration = await iterator . next ( ) ;
1060
1059
} catch ( rawError ) {
1060
+ // FIXME: add coverage for non-streamed async iterator error within a deferred payload
1061
+ const errors =
1062
+ /* c8 ignore start */ asyncPayloadRecord ?. errors ??
1063
+ /* c8 ignore stop */ exeContext . errors ;
1061
1064
addError ( rawError , fieldNodes , itemType , itemPath , errors ) ;
1062
1065
completedResults . push ( null ) ;
1063
1066
break ;
@@ -1071,7 +1074,6 @@ async function completeAsyncIteratorValue(
1071
1074
completeListItemValue (
1072
1075
iteration . value ,
1073
1076
completedResults ,
1074
- errors ,
1075
1077
exeContext ,
1076
1078
itemType ,
1077
1079
fieldNodes ,
@@ -1101,7 +1103,6 @@ function completeListValue(
1101
1103
asyncPayloadRecord ?: AsyncPayloadRecord ,
1102
1104
) : PromiseOrValue < ReadonlyArray < unknown > > {
1103
1105
const itemType = returnType . ofType ;
1104
- const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
1105
1106
1106
1107
if ( isAsyncIterable ( result ) ) {
1107
1108
const iterator = result [ Symbol . asyncIterator ] ( ) ;
@@ -1160,7 +1161,6 @@ function completeListValue(
1160
1161
completeListItemValue (
1161
1162
item ,
1162
1163
completedResults ,
1163
- errors ,
1164
1164
exeContext ,
1165
1165
itemType ,
1166
1166
fieldNodes ,
@@ -1186,7 +1186,6 @@ function completeListValue(
1186
1186
function completeListItemValue (
1187
1187
item : unknown ,
1188
1188
completedResults : Array < unknown > ,
1189
- errors : Array < GraphQLError > ,
1190
1189
exeContext : ExecutionContext ,
1191
1190
itemType : GraphQLOutputType ,
1192
1191
fieldNodes : ReadonlyArray < FieldNode > ,
@@ -1226,6 +1225,10 @@ function completeListItemValue(
1226
1225
// to take a second callback for the error case.
1227
1226
completedResults . push (
1228
1227
completedItem . then ( undefined , ( rawError ) => {
1228
+ // FIXME: add coverage for async rejection of a promise item within a deferred payload
1229
+ const errors =
1230
+ /* c8 ignore start */ asyncPayloadRecord ?. errors ??
1231
+ /* c8 ignore stop */ exeContext . errors ;
1229
1232
addError ( rawError , fieldNodes , itemType , itemPath , errors ) ;
1230
1233
filterSubsequentPayloads ( exeContext , itemPath , asyncPayloadRecord ) ;
1231
1234
return null ;
@@ -1237,6 +1240,10 @@ function completeListItemValue(
1237
1240
1238
1241
completedResults . push ( completedItem ) ;
1239
1242
} catch ( rawError ) {
1243
+ // FIXME: add coverage for sync rejection of a promise item within a deferred payload
1244
+ const errors =
1245
+ /* c8 ignore start */ asyncPayloadRecord ?. errors ??
1246
+ /* c8 ignore stop */ exeContext . errors ;
1240
1247
addError ( rawError , fieldNodes , itemType , itemPath , errors ) ;
1241
1248
filterSubsequentPayloads ( exeContext , itemPath , asyncPayloadRecord ) ;
1242
1249
completedResults . push ( null ) ;
0 commit comments