Skip to content

Commit 220e8d4

Browse files
committed
Allow empty selection sets
1 parent 1fe9b61 commit 220e8d4

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

spec/Appendix C -- Grammar Summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ OperationDefinition :
156156

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

159-
SelectionSet : { Selection+ }
159+
SelectionSet : { Selection\* }
160160

161161
Selection :
162162

spec/Section 2 -- Language.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Note: many examples below will use the query shorthand syntax.
383383

384384
## Selection Sets
385385

386-
SelectionSet : { Selection+ }
386+
SelectionSet : { Selection\* }
387387

388388
Selection :
389389

spec/Section 3 -- Type System.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ Where `name` is a field that will yield a {String} value, and `age` is a field
716716
that will yield an {Int} value, and `picture` is a field that will yield a `Url`
717717
value.
718718

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

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

19401939
Inputs (such as field arguments), are always optional by default. However a
19411940
non-null input type is required. In addition to not accepting the value {null},

spec/Section 5 -- Validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,9 @@ fragment conflictingDifferingResponses on Pet {
720720
- For each {selection} in the document:
721721
- Let {selectionType} be the unwrapped result type of {selection}.
722722
- If {selectionType} is a scalar or enum:
723-
- The subselection set of that selection must be empty.
723+
- The subselection set of that selection must not be present.
724724
- If {selectionType} is an interface, union, or object:
725-
- The subselection set of that selection must not be empty.
725+
- The subselection set of that selection must be present.
726726

727727
**Explanatory Text**
728728

0 commit comments

Comments
 (0)