@@ -137,16 +137,18 @@ ExecuteQuery(query, schema, variableValues, initialValue):
137
137
* normally* (allowing parallelization).
138
138
* Let {errors} be any * field errors* produced while executing the
139
139
selection set.
140
- * Yield an unordered map containing {data} and {errors}.
141
- * For each {payload} in {subsequentPayloads}:
142
- * If {payload} is a Deferred Fragment Record:
143
- * Yield the value from calling {ResolveDeferredFragmentRecord(payload, variableValues, subsequentPayloads)}.
144
- * If {payload} is not the final payload in {subsequentPayloads}
145
- * Add an entry to {payload} named ` hasNext ` with the value {true}.
146
- * If {payload} is the final payload in {subsequentPayloads}
147
- * Add an entry to {payload} named ` hasNext ` with the value {false}.
148
- * If {payload} is a Stream Record:
149
- * Yield ResolveStreamRecord(payload, variableValues, subsequentPayloads).
140
+ * Yield an unordered map containing {data}, {errors} and {hasNext} if
141
+ {subsequentPayloads} is non-empty.
142
+ * For each {record} in {subsequentPayloads}:
143
+ * If {record} is a Deferred Fragment Record:
144
+ * Let {payload} be the result of running {ResolveDeferredFragmentRecord(record, variableValues, subsequentPayloads)}.
145
+ * If {record} is a Stream Record:
146
+ * Let {payload} be the result of running ResolveStreamRecord(record, variableValues, subsequentPayloads).
147
+ * If {record} is not the final element in {subsequentPayloads}
148
+ * Add an entry to {payload} named ` hasNext ` with the value {true}.
149
+ * If {record} is the final element in {subsequentPayloads}
150
+ * Add an entry to {payload} named ` hasNext ` with the value {false}.
151
+ * Yield {payload}
150
152
151
153
### Mutation
152
154
@@ -580,13 +582,13 @@ DeferFragment(objectType, objectValue, fragmentSelectionSet, parentPath):
580
582
#### Deferred Fragment Record
581
583
582
584
** Formal Specification**
583
- Let {deferredFragment } be an inline fragment or fragment spread with ` @defer ` provided.
585
+ Let {deferredFragmentRecord } be an inline fragment or fragment spread with ` @defer ` provided.
584
586
Deferred Fragment Record is a structure containing:
585
587
* {label} value derived from the ` @defer ` directive.
586
- * {objectType} of the {deferredFragment }.
587
- * {objectValue} of the {deferredFragment }.
588
- * {fragmentSelectionSet}: the top level selection set of {deferredFragment }.
589
- * {path} a list of field names and indices from root to {deferredFragment }.
588
+ * {objectType} of the {deferredFragmentRecord }.
589
+ * {objectValue} of the {deferredFragmentRecord }.
590
+ * {fragmentSelectionSet}: the top level selection set of {deferredFragmentRecord }.
591
+ * {path} a list of field names and indices from root to {deferredFragmentRecord }.
590
592
591
593
CreateDeferredFragmentRecord(label, objectType, objectValue, fragmentSelectionSet, path):
592
594
* If {path} is not provided, initialize it to an empty list.
@@ -749,18 +751,18 @@ CreateStreamRecord(label, initialCount, iterator, resolvedItems, index, fields,
749
751
* Construct a stream record based on the parameters passed in.
750
752
751
753
ResolveStreamRecord(streamRecord, variableValues, subsequentPayloads):
752
- * Let {label}, {iterator}, {resolvedItems}, {index}, {path}, {fields},
753
- {innerType} be the correspondent fields on the Stream Record structure.
754
- * Remove the first entry from {resolvedItem}, let the entry be {item}. If
755
- {resolvedItem} is empty, retrieve more items from {iterator}:
756
- * Append {index} to {path}.
757
- * Increment {index}.
758
- * Let {payload} be the result of calling CompleteValue(innerType, fields, item, variableValues, subsequentPayloads, path)}.
759
- * Add an entry to {payload} named ` label ` with the value {label}.
760
- * Add an entry to {payload} named ` path ` with the value {path}.
761
- * If {resolveItem} is not empty or {iterator} does not reach the end:
762
- * Append {streamRecord} to {subsequentPayloads}.
763
- * Return {payload}.
754
+ * Let {label}, {iterator}, {resolvedItems}, {index}, {path}, {fields},
755
+ {innerType} be the correspondent fields on the Stream Record structure.
756
+ * Remove the first entry from {resolvedItem}, let the entry be {item}. If
757
+ {resolvedItem} is empty, retrieve more items from {iterator}:
758
+ * Append {index} to {path}.
759
+ * Increment {index}.
760
+ * Let {payload} be the result of calling CompleteValue(innerType, fields, item, variableValues, subsequentPayloads, path)}.
761
+ * Add an entry to {payload} named ` label ` with the value {label}.
762
+ * Add an entry to {payload} named ` path ` with the value {path}.
763
+ * If {resolveItem} is not empty or {iterator} does not reach the end:
764
+ * Append {streamRecord} to {subsequentPayloads}.
765
+ * Return {payload}.
764
766
765
767
766
768
CompleteValue(fieldType, fields, result, variableValues, subsequentPayloads, parentPath):
0 commit comments