@@ -1189,14 +1189,36 @@ function completeListValue(
1189
1189
) ;
1190
1190
}
1191
1191
1192
+ return completeIterableValue (
1193
+ exeContext ,
1194
+ itemType ,
1195
+ fieldGroup ,
1196
+ info ,
1197
+ path ,
1198
+ result ,
1199
+ incrementalContext ,
1200
+ deferMap ,
1201
+ ) ;
1202
+ }
1203
+
1204
+ function completeIterableValue (
1205
+ exeContext : ExecutionContext ,
1206
+ itemType : GraphQLOutputType ,
1207
+ fieldGroup : FieldGroup ,
1208
+ info : GraphQLResolveInfo ,
1209
+ path : Path ,
1210
+ items : Iterable < unknown > ,
1211
+ incrementalContext : IncrementalContext | undefined ,
1212
+ deferMap : ReadonlyMap < DeferUsage , DeferredFragmentRecord > | undefined ,
1213
+ ) : PromiseOrValue < GraphQLResult < ReadonlyArray < unknown > > > {
1192
1214
// This is specified as a simple map, however we're optimizing the path
1193
1215
// where the list contains no Promises by avoiding creating another Promise.
1194
1216
let containsPromise = false ;
1195
1217
const completedResults : Array < unknown > = [ ] ;
1196
1218
const acc : GraphQLResult < Array < unknown > > = [ completedResults , [ ] ] ;
1197
1219
let index = 0 ;
1198
1220
const streamUsage = getStreamUsage ( exeContext , fieldGroup , path ) ;
1199
- const iterator = result [ Symbol . iterator ] ( ) ;
1221
+ const iterator = items [ Symbol . iterator ] ( ) ;
1200
1222
let iteration = iterator . next ( ) ;
1201
1223
while ( ! iteration . done ) {
1202
1224
const item = iteration . value ;
0 commit comments