Skip to content

[RFC] allow empty selections #674

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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/Section 2 -- Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Note: many examples below will use the query short-hand syntax.

## Selection Sets

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

Selection :
- Field
Expand Down
10 changes: 9 additions & 1 deletion spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ fragment conflictingDifferingResponses on Pet {
* If {selectionType} is a scalar or enum:
* The subselection set of that selection must be empty
* 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 exist, but CAN BE empty

**Explanatory Text**

Expand Down Expand Up @@ -624,6 +624,14 @@ query directQueryOnUnionWithoutSubFields {
}
```

However, an empty selection is valid

```graphql example
query directQueryOnObjectWithEmptySubFields {
catOrDog {}
}
```


## Arguments

Expand Down