Skip to content

Commit 97d43ba

Browse files
committed
include changes after merging master
1 parent 22c5888 commit 97d43ba

File tree

3 files changed

+34
-33
lines changed

3 files changed

+34
-33
lines changed

spec/Section 3 -- Type System.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ type Person {
779779
}
780780
```
781781

782-
Valid operations must supply a _selection set_ for any field which returns an
783-
object, so this operation is not valid:
782+
Valid operations must supply a _selection set_ for every field of an object
783+
type, so this operation is not valid:
784784

785785
```graphql counter-example
786786
{

spec/Section 5 -- Validation.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,17 @@ query getName {
311311
CollectSubscriptionFields(objectType, selectionSet, visitedFragments):
312312

313313
- If {visitedFragments} is not provided, initialize it to the empty set.
314-
- Initialize {groupedFields} to an empty ordered map of lists.
314+
- Initialize {collectedFieldsMap} to an empty ordered map of ordered sets.
315315
- For each {selection} in {selectionSet}:
316316
- {selection} must not provide the `@skip` directive.
317317
- {selection} must not provide the `@include` directive.
318318
- If {selection} is a {Field}:
319-
- Let {responseKey} be the response key of {selection} (the alias if
319+
- Let {responseName} be the _response name_ of {selection} (the alias if
320320
defined, otherwise the field name).
321-
- Let {groupForResponseKey} be the list in {groupedFields} for
322-
{responseKey}; if no such list exists, create it as an empty list.
323-
- Append {selection} to the {groupForResponseKey}.
321+
- Let {fieldsForResponseKey} be the _field set_ value in
322+
{collectedFieldsMap} for the key {responseName}; otherwise create the
323+
entry with an empty ordered set.
324+
- Add {selection} to the {fieldsForResponseKey}.
324325
- If {selection} is a {FragmentSpread}:
325326
- Let {fragmentSpreadName} be the name of {selection}.
326327
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -334,31 +335,31 @@ CollectSubscriptionFields(objectType, selectionSet, visitedFragments):
334335
- If {DoesFragmentTypeApply(objectType, fragmentType)} is {false}, continue
335336
with the next {selection} in {selectionSet}.
336337
- Let {fragmentSelectionSet} be the top-level selection set of {fragment}.
337-
- Let {fragmentGroupedFieldSet} be the result of calling
338+
- Let {fragmentCollectedFieldMap} be the result of calling
338339
{CollectSubscriptionFields(objectType, fragmentSelectionSet,
339340
visitedFragments)}.
340-
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
341-
- Let {responseKey} be the response key shared by all fields in
342-
{fragmentGroup}.
343-
- Let {groupForResponseKey} be the list in {groupedFields} for
344-
{responseKey}; if no such list exists, create it as an empty list.
345-
- Append all items in {fragmentGroup} to {groupForResponseKey}.
341+
- For each {fragmentCollectedFieldMap} as {responseName} and
342+
{fragmentFields}:
343+
- Let {fieldsForResponseKey} be the _field set_ value in
344+
{collectedFieldsMap} for the key {responseName}; otherwise create the
345+
entry with an empty ordered set.
346+
- Add each item from {fragmentFields} to {fieldsForResponseKey}.
346347
- If {selection} is an {InlineFragment}:
347348
- Let {fragmentType} be the type condition on {selection}.
348349
- If {fragmentType} is not {null} and {DoesFragmentTypeApply(objectType,
349350
fragmentType)} is {false}, continue with the next {selection} in
350351
{selectionSet}.
351352
- Let {fragmentSelectionSet} be the top-level selection set of {selection}.
352-
- Let {fragmentGroupedFieldSet} be the result of calling
353+
- Let {fragmentCollectedFieldMap} be the result of calling
353354
{CollectSubscriptionFields(objectType, fragmentSelectionSet,
354355
visitedFragments)}.
355-
- For each {fragmentGroup} in {fragmentGroupedFieldSet}:
356-
- Let {responseKey} be the response key shared by all fields in
357-
{fragmentGroup}.
358-
- Let {groupForResponseKey} be the list in {groupedFields} for
359-
{responseKey}; if no such list exists, create it as an empty list.
360-
- Append all items in {fragmentGroup} to {groupForResponseKey}.
361-
- Return {groupedFields}.
356+
- For each {fragmentCollectedFieldMap} as {responseName} and
357+
{fragmentFields}:
358+
- Let {fieldsForResponseKey} be the _field set_ value in
359+
{collectedFieldsMap} for the key {responseName}; otherwise create the
360+
entry with an empty ordered set.
361+
- Add each item from {fragmentFields} to {fieldsForResponseKey}.
362+
- Return {collectedFieldsMap}.
362363

363364
Note: This algorithm is very similar to {CollectFields()}, it differs in that it
364365
does not have access to runtime variables and thus the `@skip` and `@include`

spec/Section 6 -- Execution.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
449449
- Let {responseName} be the _response name_ of {selection} (the alias if
450450
defined, otherwise the field name).
451451
- Let {fieldsForResponseName} be the _field set_ value in
452-
{collectedFieldsMap} for the key {responseName}; otherwise create it as an
453-
empty ordered set.
454-
- Append {selection} to the {fieldsForResponseName}.
452+
{collectedFieldsMap} for the key {responseName}; otherwise create the
453+
entry with an empty ordered set.
454+
- Add {selection} to the {fieldsForResponseName}.
455455
- If {selection} is a {FragmentSpread}:
456456
- Let {fragmentSpreadName} be the name of {selection}.
457457
- If {fragmentSpreadName} is in {visitedFragments}, continue with the next
@@ -471,9 +471,9 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
471471
- For each {fragmentCollectedFieldMap} as {responseName} and
472472
{fragmentFields}:
473473
- Let {fieldsForResponseName} be the _field set_ value in
474-
{collectedFieldsMap} for the key {responseName}; otherwise create it as
475-
an empty ordered set.
476-
- Add each items from {fragmentFields} to {fieldsForResponseName}.
474+
{collectedFieldsMap} for the key {responseName}; otherwise create the
475+
entry with an empty ordered set.
476+
- Add each item from {fragmentFields} to {fieldsForResponseName}.
477477
- If {selection} is an {InlineFragment}:
478478
- Let {fragmentType} be the type condition on {selection}.
479479
- If {fragmentType} is not {null} and {DoesFragmentTypeApply(objectType,
@@ -486,9 +486,9 @@ CollectFields(objectType, selectionSet, variableValues, visitedFragments):
486486
- For each {fragmentCollectedFieldMap} as {responseName} and
487487
{fragmentFields}:
488488
- Let {fieldsForResponseName} be the _field set_ value in
489-
{collectedFieldsMap} for the key {responseName}; otherwise create it as
490-
an empty ordered set.
491-
- Append all items in {fragmentFields} to {fieldsForResponseName}.
489+
{collectedFieldsMap} for the key {responseName}; otherwise create the
490+
entry with an empty ordered set.
491+
- Append each item from {fragmentFields} to {fieldsForResponseName}.
492492
- Return {collectedFieldsMap}.
493493

494494
DoesFragmentTypeApply(objectType, fragmentType):
@@ -535,8 +535,8 @@ fragment ExampleFragment on Query {
535535
```
536536

537537
After resolving the value for field `"a"`, the following multiple selection sets
538-
are merged together so `"subfield1"` and `"subfield2"` are resolved in the same
539-
phase with the same value.
538+
are collected and merged together so `"subfield1"` and `"subfield2"` are
539+
resolved in the same phase with the same value.
540540

541541
CollectSubfields(objectType, fields, variableValues):
542542

0 commit comments

Comments
 (0)