@@ -393,9 +393,9 @@ YieldSubsequentPayloads(subsequentPayloads):
393
393
- Return.
394
394
- If {subsequentPayloads} is not empty:
395
395
- Continue to the next record in {subsequentPayloads}.
396
- - If {record} is not the final element in {subsequentPayloads}
396
+ - If {record} is not the final element in {subsequentPayloads}:
397
397
- Add an entry to {payload} named ` hasNext ` with the value {true}.
398
- - If {record} is the final element in {subsequentPayloads}
398
+ - If {record} is the final element in {subsequentPayloads}:
399
399
- Add an entry to {payload} named ` hasNext ` with the value {false}.
400
400
- Yield {payload}
401
401
@@ -693,11 +693,16 @@ path, variableValues, parentRecord, subsequentPayloads):
693
693
- Let {deferRecord} be an async payload record created from {label} and {path}.
694
694
- Initialize {errors} on {deferRecord} to an empty list.
695
695
- Let {dataExecution} be the asynchronous future value of:
696
- - Let {payload} be the result of {ExecuteSelectionSet(fragmentSelectionSet,
696
+ - Let {payload} be an unordered map.
697
+ - Let {data} be the result of {ExecuteSelectionSet(fragmentSelectionSet,
697
698
objectType, objectValue, variableValues, path, subsequentPayloads,
698
699
deferRecord)}.
700
+ - Append any encountered field errors to {errors}.
699
701
- If {parentRecord} is defined:
700
702
- Wait for the result of {dataExecution} on {parentRecord}.
703
+ - If {errors} is not empty:
704
+ - Add an entry to {payload} named ` errors ` with the value {errors}.
705
+ - Add an entry to {payload} named ` data ` with the value {data}.
701
706
- Add an entry to {payload} named ` label ` with the value {label}.
702
707
- Add an entry to {payload} named ` path ` with the value {path}.
703
708
- Return {payload}.
@@ -848,8 +853,8 @@ directive.
848
853
849
854
#### Execute Stream Field
850
855
851
- ExecuteStreamRecord (label, iterator, index, fields, innerType, path
852
- streamRecord, variableValues, subsequentPayloads):
856
+ ExecuteStreamField (label, iterator, index, fields, innerType, path streamRecord,
857
+ variableValues, subsequentPayloads):
853
858
854
859
- Let {streamRecord} be an async payload record created from {label}, {path},
855
860
and {iterator}.
@@ -859,14 +864,19 @@ streamRecord, variableValues, subsequentPayloads):
859
864
- Wait for the next item from {iterator}.
860
865
- If an item is not retrieved because {iterator} has completed:
861
866
- Return {null}.
867
+ - Let {payload} be an unordered map.
862
868
- Let {item} be the item retrieved from {iterator}.
863
- - Let {payload} be the result of calling {CompleteValue(innerType, fields,
864
- item, variableValues, indexPath, subsequentPayloads, parentRecord)}.
869
+ - Let {data} be the result of calling {CompleteValue(innerType, fields, item,
870
+ variableValues, indexPath, subsequentPayloads, parentRecord)}.
871
+ - Append any encountered field errors to {errors}.
865
872
- Increment {index}.
866
- - Call {ExecuteStreamRecord (label, iterator, index, fields, innerType, path,
873
+ - Call {ExecuteStreamField (label, iterator, index, fields, innerType, path,
867
874
streamRecord, variableValues, subsequentPayloads)}.
868
875
- If {parentRecord} is defined:
869
876
- Wait for the result of {dataExecution} on {parentRecord}.
877
+ - If {errors} is not empty:
878
+ - Add an entry to {payload} named ` errors ` with the value {errors}.
879
+ - Add an entry to {payload} named ` data ` with the value {data}.
870
880
- Add an entry to {payload} named ` label ` with the value {label}.
871
881
- Add an entry to {payload} named ` path ` with the value {indexPath}.
872
882
- Return {payload}.
@@ -909,7 +919,7 @@ subsequentPayloads, asyncRecord):
909
919
- Increment {index}.
910
920
- If {streamDirective} was provided and {index} is greater than or equal
911
921
to {initialCount}:
912
- - Call {ExecuteStreamRecord (label, result, index, fields, innerType,
922
+ - Call {ExecuteStreamField (label, result, index, fields, innerType,
913
923
path, asyncRecord, subsequentPayloads)}.
914
924
- Let {result} be {initialItems}.
915
925
- Exit while loop.
0 commit comments