Skip to content

Commit 270b409

Browse files
committed
stream if argument, indexPath -> itemPath
1 parent 1ff999e commit 270b409

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
@@ -863,7 +863,7 @@ variableValues, subsequentPayloads):
863863
- Let {streamRecord} be an async payload record created from {label}, {path},
864864
and {iterator}.
865865
- Initialize {errors} on {streamRecord} to an empty list.
866-
- Let {indexPath} be {path} with {index} appended.
866+
- Let {itemPath} be {path} with {index} appended.
867867
- Let {dataExecution} be the asynchronous future value of:
868868
- Wait for the next item from {iterator}.
869869
- If an item is not retrieved because {iterator} has completed:
@@ -872,7 +872,7 @@ variableValues, subsequentPayloads):
872872
- Let {payload} be an unordered map.
873873
- Let {item} be the item retrieved from {iterator}.
874874
- Let {data} be the result of calling {CompleteValue(innerType, fields, item,
875-
variableValues, indexPath, subsequentPayloads, parentRecord)}.
875+
variableValues, itemPath, subsequentPayloads, parentRecord)}.
876876
- Append any encountered field errors to {errors}.
877877
- Increment {index}.
878878
- Call {ExecuteStreamField(label, iterator, index, fields, innerType, path,
@@ -883,7 +883,7 @@ variableValues, subsequentPayloads):
883883
- Add an entry to {payload} named `errors` with the value {errors}.
884884
- Add an entry to {payload} named `data` with the value {data}.
885885
- Add an entry to {payload} named `label` with the value {label}.
886-
- Add an entry to {payload} named `path` with the value {indexPath}.
886+
- Add an entry to {payload} named `path` with the value {itemPath}.
887887
- Return {payload}.
888888
- Set {dataExecution} on {streamRecord}.
889889
- Append {streamRecord} to {subsequentPayloads}.
@@ -903,7 +903,9 @@ subsequentPayloads, asyncRecord):
903903
- If {result} is an iterator:
904904
- Let {field} be the first entry in {fields}.
905905
- Let {innerType} be the inner type of {fieldType}.
906-
- Let {streamDirective} be the `@stream` directive provided on {field}.
906+
- If {field} provides the directive `@stream` and its {if} argument is
907+
{true} or is a variable in {variableValues} with the value {true} and :
908+
- Let {streamDirective} be that directive.
907909
- Let {initialCount} be the value or variable provided to
908910
{streamDirective}'s {initialCount} argument.
909911
- If {initialCount} is less than zero, raise a _field error_.
@@ -912,18 +914,18 @@ subsequentPayloads, asyncRecord):
912914
- Let {initialItems} be an empty list
913915
- Let {index} be zero.
914916
- While {result} is not closed:
915-
- If {streamDirective} was not provided or {index} is not greater than or
917+
- If {streamDirective} is not defined or {index} is not greater than or
916918
equal to {initialCount}:
917919
- Wait for the next item from {result}.
918920
- Let {resultItem} be the item retrieved from {result}.
919-
- Let {indexPath} be {path} with {index} appended.
921+
- Let {itemPath} be {path} with {index} appended.
920922
- Let {resolvedItem} be the result of calling {CompleteValue(innerType,
921-
fields, resultItem, variableValues, indexPath, subsequentPayloads,
923+
fields, resultItem, variableValues, itemPath, subsequentPayloads,
922924
asyncRecord)}.
923925
- Append {resolvedItem} to {initialItems}.
924926
- Increment {index}.
925-
- If {streamDirective} was provided and {index} is greater than or equal
926-
to {initialCount}:
927+
- If {streamDirective} is defined and {index} is greater than or equal to
928+
{initialCount}:
927929
- Call {ExecuteStreamField(label, result, index, fields, innerType,
928930
path, asyncRecord, subsequentPayloads)}.
929931
- Let {result} be {initialItems}.
@@ -932,9 +934,9 @@ subsequentPayloads, asyncRecord):
932934
- If {result} is not a collection of values, raise a _field error_.
933935
- Let {innerType} be the inner type of {fieldType}.
934936
- Return a list where each list item is the result of calling
935-
{CompleteValue(innerType, fields, resultItem, variableValues, indexPath,
937+
{CompleteValue(innerType, fields, resultItem, variableValues, itemPath,
936938
subsequentPayloads, asyncRecord)}, where {resultItem} is each item in
937-
{result} and {indexPath} is {path} with the index of the item appended.
939+
{result} and {itemPath} is {path} with the index of the item appended.
938940
- If {fieldType} is a Scalar or Enum type:
939941
- Return the result of {CoerceResult(fieldType, result)}.
940942
- If {fieldType} is an Object, Interface, or Union type:

0 commit comments

Comments
 (0)