-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Minor editorial tweaks following the merge of #1039 #1175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
700992e
c717d5e
7e8ae94
63f68d6
9a83fff
5990d1c
82654e4
eb62229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,11 +334,11 @@ CollectSubscriptionFields(objectType, selectionSet, visitedFragments): | |
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue | ||
with the next {selection} in {selectionSet}. | ||
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}. | ||
- Let {fragmentCollectedFieldMap} be the result of calling | ||
- Let {fragmentCollectedFieldsMap} be the result of calling | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. + There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah thanks - that was my intent |
||
{CollectSubscriptionFields(objectType, fragmentSelectionSet, | ||
visitedFragments)}. | ||
- For each {responseName} and {fragmentFields} in | ||
{fragmentCollectedFieldMap}: | ||
{fragmentCollectedFieldsMap}: | ||
- Let {fieldsForResponseKey} be the _field set_ value in | ||
{collectedFieldsMap} for the key {responseName}; otherwise create the | ||
entry with an empty ordered set. | ||
|
@@ -349,11 +349,11 @@ CollectSubscriptionFields(objectType, selectionSet, visitedFragments): | |
fragmentType)} is {false}, continue with the next {selection} in | ||
{selectionSet}. | ||
- Let {fragmentSelectionSet} be the top-level selection set of {selection}. | ||
- Let {fragmentCollectedFieldMap} be the result of calling | ||
- Let {fragmentCollectedFieldsMap} be the result of calling | ||
{CollectSubscriptionFields(objectType, fragmentSelectionSet, | ||
visitedFragments)}. | ||
- For each {responseName} and {fragmentFields} in | ||
{fragmentCollectedFieldMap}: | ||
{fragmentCollectedFieldsMap}: | ||
- Let {fieldsForResponseKey} be the _field set_ value in | ||
{collectedFieldsMap} for the key {responseName}; otherwise create the | ||
entry with an empty ordered set. | ||
|
@@ -584,7 +584,7 @@ should be unambiguous. Therefore any two field selections which might both be | |
encountered for the same object are only valid if they are equivalent. | ||
|
||
During execution, the simultaneous execution of fields with the same response | ||
name is accomplished by {CollectSubfields()} before execution. | ||
name is accomplished by performing {CollectSubfields()} before their execution. | ||
Comment on lines
586
to
+587
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
For simple hand-written GraphQL, this rule is obviously a clear developer error, | ||
however nested fragments can make this difficult to detect manually. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,9 +369,9 @@ continues until there are no more subfields to collect and execute. | |
operation. A root selection set always selects from a _root operation type_. | ||
|
||
To execute the root selection set, the initial value being evaluated and the | ||
root type must be known, as well as whether each field must be executed | ||
serially, or normally by executing all fields in parallel (see | ||
[Normal and Serial Execution](#sec-Normal-and-Serial-Execution). | ||
root type must be known, as well as whether the fields must be executed in a | ||
series, or normally by executing all fields in parallel (see | ||
Comment on lines
+372
to
+373
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "each field must be executed serially" sounds like the serial-ness is a property of the fields own execution (e.g. of its resolver and sub selection set), rather than it's contextual execution relative to its sibling fields. Minor tweak for clarity. |
||
[Normal and Serial Execution](#sec-Normal-and-Serial-Execution)). | ||
|
||
Executing the root selection set works similarly for queries (parallel), | ||
mutations (serial), and subscriptions (where it is executed for each event in | ||
|
@@ -396,10 +396,9 @@ executionMode): | |
### Field Collection | ||
|
||
Before execution, each _selection set_ is converted to a _collected fields map_ | ||
by calling {CollectFields()} by collecting all fields with the same response | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merely deleted |
||
name, including those in referenced fragments, into an individual _field set_. | ||
This ensures that multiple references to fields with the same response name will | ||
only be executed once. | ||
by collecting all fields with the same response name, including those in | ||
referenced fragments, into an individual _field set_. This ensures that multiple | ||
references to fields with the same response name will only be executed once. | ||
|
||
:: A _collected fields map_ is an ordered map where each entry is a _response | ||
name_ and its associated _field set_. A _collected fields map_ may be produced | ||
|
@@ -436,8 +435,8 @@ fragment ExampleFragment on Query { | |
} | ||
``` | ||
|
||
The depth-first-search order of the _field set_ produced by {CollectFields()} is | ||
maintained through execution, ensuring that fields appear in the executed | ||
The depth-first-search order of each _field set_ 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, visitedFragments): | ||
|
@@ -475,11 +474,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments): | |
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue | ||
with the next {selection} in {selectionSet}. | ||
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}. | ||
- Let {fragmentCollectedFieldMap} be the result of calling | ||
- Let {fragmentCollectedFieldsMap} be the result of calling | ||
{CollectFields(objectType, fragmentSelectionSet, variableValues, | ||
visitedFragments)}. | ||
- For each {responseName} and {fragmentFields} in | ||
{fragmentCollectedFieldMap}: | ||
{fragmentCollectedFieldsMap}: | ||
- Let {fieldsForResponseName} be the _field set_ value in | ||
{collectedFieldsMap} for the key {responseName}; otherwise create the | ||
entry with an empty ordered set. | ||
|
@@ -490,11 +489,11 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments): | |
fragmentType)} is {false}, continue with the next {selection} in | ||
{selectionSet}. | ||
- Let {fragmentSelectionSet} be the top-level selection set of {selection}. | ||
- Let {fragmentCollectedFieldMap} be the result of calling | ||
- Let {fragmentCollectedFieldsMap} be the result of calling | ||
{CollectFields(objectType, fragmentSelectionSet, variableValues, | ||
visitedFragments)}. | ||
- For each {responseName} and {fragmentFields} in | ||
{fragmentCollectedFieldMap}: | ||
{fragmentCollectedFieldsMap}: | ||
- Let {fieldsForResponseName} be the _field set_ value in | ||
{collectedFieldsMap} for the key {responseName}; otherwise create the | ||
entry with an empty ordered set. | ||
|
@@ -518,8 +517,8 @@ directives may be applied in either order since they apply commutatively. | |
|
||
**Merging Selection Sets** | ||
|
||
In order to execute the sub-selections of a object typed field, all _selection | ||
sets_ of each field with the same response name of the parent _field set_ are | ||
In order to execute the sub-selections of an object typed field, all _selection | ||
sets_ of each field with the same response name in the parent _field set_ are | ||
merged together into a single _collected fields map_ representing the subfields | ||
to be executed next. | ||
|
||
|
@@ -554,9 +553,9 @@ CollectSubfields(objectType, fields, variableValues): | |
- For each {field} in {fields}: | ||
- Let {fieldSelectionSet} be the selection set of {field}. | ||
- If {fieldSelectionSet} is null or empty, continue to the next field. | ||
- Let {fieldCollectedFieldMap} be the result of {CollectFields(objectType, | ||
- Let {fieldCollectedFieldsMap} be the result of {CollectFields(objectType, | ||
fieldSelectionSet, variableValues)}. | ||
- For each {responseName} and {subfields} in {fieldCollectedFieldMap}: | ||
- For each {responseName} and {subfields} in {fieldCollectedFieldsMap}: | ||
- Let {fieldsForResponseName} be the _field set_ value in | ||
{collectedFieldsMap} for the key {responseName}; otherwise create the | ||
entry with an empty ordered set. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User.name
is a "field of an object type", but should not have a selection set.