Skip to content

Commit

Permalink
CollectFields does not require path or asyncRecord (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR authored Jan 16, 2023
1 parent 8df13da commit 94363c9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ subsequentPayloads, asyncRecord):
- If {path} is not provided, initialize it to an empty list.
- If {subsequentPayloads} is not provided, initialize it to the empty set.
- Let {groupedFieldSet} and {deferredGroupedFieldsList} be the result of
{CollectFields(objectType, selectionSet, variableValues, path, asyncRecord)}.
{CollectFields(objectType, selectionSet, variableValues)}.
- Initialize {resultMap} to an empty ordered map.
- For each {groupedFieldSet} as {responseKey} and {fields}:
- Let {fieldName} be the name of the first entry in {fields}. Note: This value
Expand Down Expand Up @@ -648,8 +648,8 @@ The depth-first-search order of the field groups produced by {CollectFields()}
is maintained through execution, ensuring that fields appear in the executed
response in a stable and predictable order.

CollectFields(objectType, selectionSet, variableValues, path, asyncRecord,
visitedFragments, deferredGroupedFieldsList):
CollectFields(objectType, selectionSet, variableValues, visitedFragments,
deferredGroupedFieldsList):

- If {visitedFragments} is not provided, initialize it to the empty set.
- Initialize {groupedFields} to an empty ordered map of lists.
Expand Down Expand Up @@ -696,14 +696,14 @@ visitedFragments, deferredGroupedFieldsList):
- Let {label} be the value or the variable to {deferDirective}'s {label}
argument.
- Let {deferredGroupedFields} be the result of calling
{CollectFields(objectType, fragmentSelectionSet, variableValues, path,
asyncRecord, visitedFragments, deferredGroupedFieldsList)}.
{CollectFields(objectType, fragmentSelectionSet, variableValues,
visitedFragments, deferredGroupedFieldsList)}.
- Append a record containing {label} and {deferredGroupedFields} to
{deferredGroupedFieldsList}.
- Continue with the next {selection} in {selectionSet}.
- Let {fragmentGroupedFieldSet} be the result of calling
{CollectFields(objectType, fragmentSelectionSet, variableValues, path,
asyncRecord, visitedFragments, deferredGroupedFieldsList)}.
{CollectFields(objectType, fragmentSelectionSet, variableValues,
visitedFragments, deferredGroupedFieldsList)}.
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
- Let {responseKey} be the response key shared by all fields in
{fragmentGroup}.
Expand All @@ -726,21 +726,21 @@ visitedFragments, deferredGroupedFieldsList):
- Let {label} be the value or the variable to {deferDirective}'s {label}
argument.
- Let {deferredGroupedFields} be the result of calling
{CollectFields(objectType, fragmentSelectionSet, variableValues, path,
asyncRecord, visitedFragments, deferredGroupedFieldsList)}.
{CollectFields(objectType, fragmentSelectionSet, variableValues,
visitedFragments, deferredGroupedFieldsList)}.
- Append a record containing {label} and {deferredGroupedFields} to
{deferredGroupedFieldsList}.
- Continue with the next {selection} in {selectionSet}.
- Let {fragmentGroupedFieldSet} be the result of calling
{CollectFields(objectType, fragmentSelectionSet, variableValues, path,
asyncRecord, visitedFragments, deferredGroupedFieldsList)}.
{CollectFields(objectType, fragmentSelectionSet, variableValues,
visitedFragments, deferredGroupedFieldsList)}.
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
- Let {responseKey} be the response key shared by all fields in
{fragmentGroup}.
- Let {groupForResponseKey} be the list in {groupedFields} for
{responseKey}; if no such list exists, create it as an empty list.
- Append all items in {fragmentGroup} to {groupForResponseKey}.
- Return {groupedFields} and {deferredGroupedFieldsList}.
- Return {groupedFields}, {deferredGroupedFieldsList} and {visitedFragments}.

Note: The steps in {CollectFields()} evaluating the `@skip` and `@include`
directives may be applied in either order since they apply commutatively.
Expand Down

0 comments on commit 94363c9

Please sign in to comment.