Skip to content
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

Clarify that selection sets cannot be empty #1025

Merged
merged 1 commit into from
May 19, 2023

Conversation

benjie
Copy link
Member

@benjie benjie commented May 19, 2023

This paragraph is trying to make clear that if you have a type like type Foo { foo: Int!, bar: Int!, baz: Int! } that the selection set { foo bar } is valid for it - you do not have to select baz even if it's non-nullable, since non-nullable does not mean "required" for output fields.

However, it does read ambiguously, implying that you may remove any field from any selection set and the selection set will still be valid. If you remove the field foo from the selection set { foo } then that selection set ({ }) is no longer valid, since it is empty.

I've added a clarifying parenthesis to the text.

Fixes #1024

@graphql/tsc Can I get a couple checkmarks please? 😉

@benjie benjie added the ✏️ Editorial PR is non-normative or does not influence implementation label May 19, 2023
@benjie benjie requested a review from a team May 19, 2023 15:06
@netlify
Copy link

netlify bot commented May 19, 2023

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit 1a818fc
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/646790952516550008b2040d
😎 Deploy Preview https://deploy-preview-1025--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@benjie benjie merged commit a5cc6ea into main May 19, 2023
@benjie benjie deleted the selection-sets-cannot-be-empty branch May 19, 2023 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Editorial PR is non-normative or does not influence implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL spec is contradictory: can selection sets be empty or not?
3 participants