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