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