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

Add definition of "selection set" and clarify serial execution examples #1032

Merged
merged 5 commits into from
Apr 4, 2024

Conversation

benjie
Copy link
Member

@benjie benjie commented Jul 8, 2023

Examples 193 and 194 relate to executing selection sets serially. There has been confusion from readers that think that these examples relate to documents (i.e. they should have the mutation keyword) but that is not necessarily the case, for example in future we might enable operations such as:

mutation {
  ... @defer {
    mutation1 { result }
    mutation2 { result }
  }
  ... @defer {
    mutation3 { result }
    mutation4 { result }
  }
}

To solve this:

  1. I've changed the first example to be a mutation operation and changed the leading text to state this explicitly
  2. For the second example I've put a note inside the example making it clear once again that this is a selection set and not a query or mutation document
  3. I've created a definition for "selection set"
  4. I've updated various references to "selection set" throughout the document (though not in algorithms) to link to this definition

I've also fixed the consistency of the casing of 'selection set'.

@benjie benjie added the ✏️ Editorial PR is non-normative or does not influence implementation label Jul 8, 2023
@netlify
Copy link

netlify bot commented Jul 8, 2023

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit db4a3c3
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/66040358b351980007f00fe6
😎 Deploy Preview https://deploy-preview-1032--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 configuration.

@benjie benjie changed the title Add definition of "selection set" and cross-link Add definition of "selection set" and clarify serial execution examples Nov 10, 2023
Comment on lines +341 to +342
:: A _selection set_ defines an ordered set of selections (fields, fragment
spreads and inline fragments) against an object, union or interface type.
Copy link
Member Author

Choose a reason for hiding this comment

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

🆕 Definition of selection set.

Comment on lines 399 to 403
For example, given the following mutation operation, the root _selection set_
must be executed serially:

```graphql example
{
mutation {
Copy link
Member Author

Choose a reason for hiding this comment

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

🆕 Clarification

Copy link
Contributor

Choose a reason for hiding this comment

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

define variable

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we add the mutation example, and keep the selection set example?


```graphql example
# Note: This is a selection set, not a full document using the query shorthand.
Copy link
Member Author

Choose a reason for hiding this comment

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

🆕 Note added

Copy link
Contributor

@mjmahone mjmahone left a comment

Choose a reason for hiding this comment

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

This seems like a positive editorial change

spec/Section 6 -- Execution.md Outdated Show resolved Hide resolved
@fotoetienne fotoetienne self-assigned this Mar 7, 2024
@benjie
Copy link
Member Author

benjie commented Mar 27, 2024

@Keweiqu I've addressed your feedback, I think? Very good catch! 🙌


```graphql example
{
mutation ChangeBirthdayAndAddress($newBirthday: String!, $newAddress: String!) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch

@leebyron leebyron merged commit b5ecff0 into main Apr 4, 2024
9 checks passed
@leebyron leebyron deleted the selection-set branch April 4, 2024 17:55
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.

None yet

7 participants