Skip to content

Commit 4528738

Browse files
authored
Merge branch 'main' into fragment-args-2024-amendments
2 parents cbf902b + b1a23de commit 4528738

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

spec/Section 3 -- Type System.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ via introspection.
5858

5959
[Descriptions](#sec-Descriptions) allow GraphQL service designers to easily
6060
provide documentation which remains consistent with the capabilities of a
61-
GraphQL service. Descriptions provided as Markdown (as specified by
61+
GraphQL service. Descriptions should be provided as Markdown (as specified by
6262
[CommonMark](https://commonmark.org/)) for every definition in a type system.
6363

6464
GraphQL schema and all other definitions (e.g. types, fields, arguments, etc.)
@@ -775,8 +775,8 @@ type Person {
775775
}
776776
```
777777

778-
Valid operations must supply a _selection set_ for every field of an object
779-
type, so this operation is not valid:
778+
Valid operations must supply a _selection set_ for every field whose return type
779+
is an object type, so this operation is not valid:
780780

781781
```graphql counter-example
782782
{

spec/Section 5 -- Validation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ CollectSubscriptionFields(objectType, selectionSet, visitedFragments):
334334
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue
335335
with the next {selection} in {selectionSet}.
336336
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}.
337-
- Let {fragmentCollectedFieldMap} be the result of calling
337+
- Let {fragmentCollectedFieldsMap} be the result of calling
338338
{CollectSubscriptionFields(objectType, fragmentSelectionSet,
339339
visitedFragments)}.
340340
- For each {responseName} and {fragmentFields} in
341-
{fragmentCollectedFieldMap}:
341+
{fragmentCollectedFieldsMap}:
342342
- Let {fieldsForResponseKey} be the _field set_ value in
343343
{collectedFieldsMap} for the key {responseName}; otherwise create the
344344
entry with an empty ordered set.
@@ -349,11 +349,11 @@ CollectSubscriptionFields(objectType, selectionSet, visitedFragments):
349349
fragmentType)} is {false}, continue with the next {selection} in
350350
{selectionSet}.
351351
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
352-
- Let {fragmentCollectedFieldMap} be the result of calling
352+
- Let {fragmentCollectedFieldsMap} be the result of calling
353353
{CollectSubscriptionFields(objectType, fragmentSelectionSet,
354354
visitedFragments)}.
355355
- For each {responseName} and {fragmentFields} in
356-
{fragmentCollectedFieldMap}:
356+
{fragmentCollectedFieldsMap}:
357357
- Let {fieldsForResponseKey} be the _field set_ value in
358358
{collectedFieldsMap} for the key {responseName}; otherwise create the
359359
entry with an empty ordered set.
@@ -591,7 +591,7 @@ should be unambiguous. Therefore any two field selections which might both be
591591
encountered for the same object are only valid if they are equivalent.
592592

593593
During execution, the simultaneous execution of fields with the same response
594-
name is accomplished by {CollectSubfields()} before execution.
594+
name is accomplished by performing {CollectSubfields()} before their execution.
595595

596596
For simple hand-written GraphQL, this rule is obviously a clear developer error,
597597
however nested fragments can make this difficult to detect manually.

spec/Section 6 -- Execution.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ continues until there are no more subfields to collect and execute.
376376
operation. A root selection set always selects from a _root operation type_.
377377

378378
To execute the root selection set, the initial value being evaluated and the
379-
root type must be known, as well as whether each field must be executed
380-
serially, or normally by executing all fields in parallel (see
381-
[Normal and Serial Execution](#sec-Normal-and-Serial-Execution).
379+
root type must be known, as well as whether the fields must be executed in a
380+
series, or normally by executing all fields in parallel (see
381+
[Normal and Serial Execution](#sec-Normal-and-Serial-Execution)).
382382

383383
Executing the root selection set works similarly for queries (parallel),
384384
mutations (serial), and subscriptions (where it is executed for each event in
@@ -403,10 +403,9 @@ executionMode):
403403
### Field Collection
404404

405405
Before execution, each _selection set_ is converted to a _collected fields map_
406-
by calling {CollectFields()} by collecting all fields with the same response
407-
name, including those in referenced fragments, into an individual _field set_.
408-
This ensures that multiple references to fields with the same response name will
409-
only be executed once.
406+
by collecting all fields with the same response name, including those in
407+
referenced fragments, into an individual _field set_. This ensures that multiple
408+
references to fields with the same response name will only be executed once.
410409

411410
:: A _collected fields map_ is an ordered map where each entry is a _response
412411
name_ and its associated _field set_. A _collected fields map_ may be produced
@@ -443,8 +442,8 @@ fragment ExampleFragment on Query {
443442
}
444443
```
445444

446-
The depth-first-search order of the _field set_ produced by {CollectFields()} is
447-
maintained through execution, ensuring that fields appear in the executed
445+
The depth-first-search order of each _field set_ produced by {CollectFields()}
446+
is maintained through execution, ensuring that fields appear in the executed
448447
response in a stable and predictable order.
449448

450449
CollectFields(objectType, selectionSet, variableValues, visitedFragments,
@@ -494,11 +493,11 @@ fragmentVariables):
494493
- Let {newFragmentVariables} be an unordered map containing {signatures} and
495494
{values}.
496495
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}.
497-
- Let {fragmentCollectedFieldMap} be the result of calling
496+
- Let {fragmentCollectedFieldsMap} be the result of calling
498497
{CollectFields(objectType, fragmentSelectionSet, variableValues,
499498
visitedFragments, newFragmentVariables)}.
500499
- For each {responseName} and {fragmentFields} in
501-
{fragmentCollectedFieldMap}:
500+
{fragmentCollectedFieldsMap}:
502501
- Let {fieldsForResponseName} be the _field set_ value in
503502
{collectedFieldsMap} for the key {responseName}; otherwise create the
504503
entry with an empty ordered set.
@@ -509,11 +508,11 @@ fragmentVariables):
509508
fragmentType)} is {false}, continue with the next {selection} in
510509
{selectionSet}.
511510
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
512-
- Let {fragmentCollectedFieldMap} be the result of calling
511+
- Let {fragmentCollectedFieldsMap} be the result of calling
513512
{CollectFields(objectType, fragmentSelectionSet, variableValues,
514513
visitedFragments, fragmentVariables)}.
515514
- For each {responseName} and {fragmentFields} in
516-
{fragmentCollectedFieldMap}:
515+
{fragmentCollectedFieldsMap}:
517516
- Let {fieldsForResponseName} be the _field set_ value in
518517
{collectedFieldsMap} for the key {responseName}; otherwise create the
519518
entry with an empty ordered set.
@@ -537,8 +536,8 @@ directives may be applied in either order since they apply commutatively.
537536

538537
**Merging Selection Sets**
539538

540-
In order to execute the sub-selections of a object typed field, all _selection
541-
sets_ of each field with the same response name of the parent _field set_ are
539+
In order to execute the sub-selections of an object typed field, all _selection
540+
sets_ of each field with the same response name in the parent _field set_ are
542541
merged together into a single _collected fields map_ representing the subfields
543542
to be executed next.
544543

@@ -573,9 +572,9 @@ CollectSubfields(objectType, fields, variableValues):
573572
- For each {field} in {fields}:
574573
- Let {fieldSelectionSet} be the selection set of {field}.
575574
- If {fieldSelectionSet} is null or empty, continue to the next field.
576-
- Let {fieldCollectedFieldMap} be the result of {CollectFields(objectType,
575+
- Let {fieldCollectedFieldsMap} be the result of {CollectFields(objectType,
577576
fieldSelectionSet, variableValues)}.
578-
- For each {responseName} and {subfieldInfos} in {fieldCollectedFieldMap}:
577+
- For each {responseName} and {subfieldInfos} in {fieldCollectedFieldsMap}:
579578
- Let {fieldsForResponseName} be the _field set_ value in
580579
{collectedFieldsMap} for the key {responseName}; otherwise create the
581580
entry with an empty ordered set.

0 commit comments

Comments
 (0)