Skip to content

Commit c867d80

Browse files
robrichardyaacovCR
authored andcommitted
stream if argument, indexPath -> itemPath
1 parent e26f70e commit c867d80

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

spec/Section 6 -- Execution.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ variableValues, subsequentPayloads):
862862
- Let {streamRecord} be an async payload record created from {label}, {path},
863863
and {iterator}.
864864
- Initialize {errors} on {streamRecord} to an empty list.
865-
- Let {indexPath} be {path} with {index} appended.
865+
- Let {itemPath} be {path} with {index} appended.
866866
- Let {dataExecution} be the asynchronous future value of:
867867
- Wait for the next item from {iterator}.
868868
- If an item is not retrieved because {iterator} has completed:
@@ -871,7 +871,7 @@ variableValues, subsequentPayloads):
871871
- Let {payload} be an unordered map.
872872
- Let {item} be the item retrieved from {iterator}.
873873
- Let {data} be the result of calling {CompleteValue(innerType, fields, item,
874-
variableValues, indexPath, subsequentPayloads, parentRecord)}.
874+
variableValues, itemPath, subsequentPayloads, parentRecord)}.
875875
- Append any encountered field errors to {errors}.
876876
- Increment {index}.
877877
- Call {ExecuteStreamField(label, iterator, index, fields, innerType, path,
@@ -882,7 +882,7 @@ variableValues, subsequentPayloads):
882882
- Add an entry to {payload} named `errors` with the value {errors}.
883883
- Add an entry to {payload} named `data` with the value {data}.
884884
- Add an entry to {payload} named `label` with the value {label}.
885-
- Add an entry to {payload} named `path` with the value {indexPath}.
885+
- Add an entry to {payload} named `path` with the value {itemPath}.
886886
- Return {payload}.
887887
- Set {dataExecution} on {streamRecord}.
888888
- Append {streamRecord} to {subsequentPayloads}.
@@ -902,7 +902,9 @@ subsequentPayloads, asyncRecord):
902902
- If {result} is an iterator:
903903
- Let {field} be the first entry in {fields}.
904904
- Let {innerType} be the inner type of {fieldType}.
905-
- Let {streamDirective} be the `@stream` directive provided on {field}.
905+
- If {field} provides the directive `@stream` and its {if} argument is
906+
{true} or is a variable in {variableValues} with the value {true} and :
907+
- Let {streamDirective} be that directive.
906908
- Let {initialCount} be the value or variable provided to
907909
{streamDirective}'s {initialCount} argument.
908910
- If {initialCount} is less than zero, raise a _field error_.
@@ -911,18 +913,18 @@ subsequentPayloads, asyncRecord):
911913
- Let {initialItems} be an empty list
912914
- Let {index} be zero.
913915
- While {result} is not closed:
914-
- If {streamDirective} was not provided or {index} is not greater than or
916+
- If {streamDirective} is not defined or {index} is not greater than or
915917
equal to {initialCount}:
916918
- Wait for the next item from {result}.
917919
- Let {resultItem} be the item retrieved from {result}.
918-
- Let {indexPath} be {path} with {index} appended.
920+
- Let {itemPath} be {path} with {index} appended.
919921
- Let {resolvedItem} be the result of calling {CompleteValue(innerType,
920-
fields, resultItem, variableValues, indexPath, subsequentPayloads,
922+
fields, resultItem, variableValues, itemPath, subsequentPayloads,
921923
asyncRecord)}.
922924
- Append {resolvedItem} to {initialItems}.
923925
- Increment {index}.
924-
- If {streamDirective} was provided and {index} is greater than or equal
925-
to {initialCount}:
926+
- If {streamDirective} is defined and {index} is greater than or equal to
927+
{initialCount}:
926928
- Call {ExecuteStreamField(label, result, index, fields, innerType,
927929
path, asyncRecord, subsequentPayloads)}.
928930
- Let {result} be {initialItems}.
@@ -931,9 +933,9 @@ subsequentPayloads, asyncRecord):
931933
- If {result} is not a collection of values, raise a _field error_.
932934
- Let {innerType} be the inner type of {fieldType}.
933935
- Return a list where each list item is the result of calling
934-
{CompleteValue(innerType, fields, resultItem, variableValues, indexPath,
936+
{CompleteValue(innerType, fields, resultItem, variableValues, itemPath,
935937
subsequentPayloads, asyncRecord)}, where {resultItem} is each item in
936-
{result} and {indexPath} is {path} with the index of the item appended.
938+
{result} and {itemPath} is {path} with the index of the item appended.
937939
- If {fieldType} is a Scalar or Enum type:
938940
- Return the result of {CoerceResult(fieldType, result)}.
939941
- If {fieldType} is an Object, Interface, or Union type:

0 commit comments

Comments
 (0)