@@ -417,16 +417,30 @@ ExecuteSelectionSet(selectionSet, objectType, objectValue, variableValues):
417
417
- Let {fieldType} be the return type defined for the field {fieldName} of
418
418
{objectType}.
419
419
- If {fieldType} is defined:
420
- - If {fieldType} is a list type and {field} provides the directive
421
- ` @stream ` , let {streamDirective} be that directive.
422
- - TODO: ` @stream(if:) `
423
- - Add {fieldDetails} to {streams}.
424
- - Else if every entry in {fieldDetails} has {isDeferred} set to {true}:
420
+ - If every entry in {fieldDetails} has {isDeferred} set to {true}:
425
421
- Add {fieldDetails} to {deferred}.
426
422
- Else:
427
423
- Let {responseValue} be {ExecuteField(objectType, objectValue, fieldType,
428
424
fieldDetails, variableValues)}.
429
- - Set {responseValue} as the value for {responseKey} in {resultMap}.
425
+ - If {responseValue} is not null and {fieldType} is a list type and
426
+ {field} provides the directive ` @stream ` , let {streamDirective} be that
427
+ directive. If {streamDirective}'s {if} argument is not {false} and is
428
+ not a variable in {variableValues} with the value {false}:
429
+ - If {streamDirective}'s {initialCount} argument is a variable:
430
+ - Let {initialCount} be the value of that variable in
431
+ {variableValues}.
432
+ - Else
433
+ - Let {initialCount} be the value of {streamDirective}'s
434
+ {initialCount} argument.
435
+ - If {initialCount} is {null}, not provided, or less than {0} then let
436
+ {initialCount} be {0}.
437
+ - Let {initialValues} be the first {initialCount} entires in
438
+ {responesValue}, and {remainingValues} be the remainder.
439
+ - Set {initialValues} as the value for {responseKey} in {resultMap}.
440
+ - If there are (or may be) values in {remainingValues}:
441
+ - TODO: add {remainingValues} to {streams} via some mechanism...
442
+ - Else:
443
+ - Set {responseValue} as the value for {responseKey} in {resultMap}.
430
444
- Let {pendings} be an empty list.
431
445
- If {deferred} is not empty:
432
446
- Add a single entry to {pendings}.
0 commit comments