Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/Appendix C -- Grammar Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ OperationDefinition :

OperationType : one of `query` `mutation` `subscription`

SelectionSet : { Selection+ }
SelectionSet : { Selection\* }

Selection :

Expand Down
2 changes: 1 addition & 1 deletion spec/Section 2 -- Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ Note: many examples below will use the query shorthand syntax.

## Selection Sets

SelectionSet : { Selection+ }
SelectionSet : { Selection\* }

Selection :

Expand Down
7 changes: 3 additions & 4 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ Where `name` is a field that will yield a {String} value, and `age` is a field
that will yield an {Int} value, and `picture` is a field that will yield a `Url`
value.

A query of an object value must select at least one field. This selection of
A query of an object value must be made via a selection set. This selection of
fields will yield an ordered map containing exactly the subset of the object
queried, which should be represented in the order in which they were queried.
Only fields that are declared on the object type may validly be queried on that
Expand Down Expand Up @@ -1933,9 +1933,8 @@ to denote a field that uses a Non-Null type like this: `name: String!`.
**Nullable vs. Optional**

Fields are _always_ optional within the context of a _selection set_, a field
may be omitted and the selection set is still valid (so long as the selection
set does not become empty). However fields that return Non-Null types will never
return the value {null} if queried.
may be omitted and the selection set is still valid. However fields that return
Non-Null types will never return the value {null} if queried.

Inputs (such as field arguments), are always optional by default. However a
non-null input type is required. In addition to not accepting the value {null},
Expand Down
4 changes: 2 additions & 2 deletions spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,9 @@ fragment conflictingDifferingResponses on Pet {
- For each {selection} in the document:
- Let {selectionType} be the unwrapped result type of {selection}.
- If {selectionType} is a scalar or enum:
- The subselection set of that selection must be empty.
- The subselection set of that selection must not be present.
- If {selectionType} is an interface, union, or object:
- The subselection set of that selection must not be empty.
- The subselection set of that selection must be present.
Comment on lines +723 to +725

@magicmark magicmark May 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty selection sets are being made valid by omission to the contrary, rather than being explicitly specified. (yes technically the grammar makes this explicit, but could be easy to miss)

"Empty selection sets are a bit weird/nonobvious, but they are valid" - is something along these lines worth calling out in the explanatory text below, or a non-norm note?


**Explanatory Text**

Expand Down
Loading