Skip to content

incrementalDelivery: use single execute function with directives as flags #3732

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

Closed
wants to merge 1 commit into from

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Sep 13, 2022

The use of new experimental functionality triggered by directives does not need a separate runtime flag. The directives themselves are the flags and all operations passed to execute are assumed to be valid.

Using TS conditional types, when new generic TMaybeIncremental parameter is set to true, return type of execute will be either an ExecutionResult or an IncrementalExecutionResultMap containing an initialResult and a generator of subsequentResults. While incremental delivery is designated as experimental, TMaybeIncremental will default to false. When incremental delivery is merged into the spec, it may be useful to adjust the default to true.

@github-actions
Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR
Copy link
Contributor Author

My current preferred alternative to #3722 / #3727 / #3726
@robrichard @glasser @IvanGoncharov

@yaacovCR yaacovCR requested review from a team and robrichard September 13, 2022 08:25
@yaacovCR yaacovCR added the PR: breaking change 💥 implementation requires increase of "major" version number label Sep 13, 2022
@yaacovCR
Copy link
Contributor Author

Even if we don't take this solution in whole, we might want to extract out the removal of the unnecessary singleResult wrapper and just add that to #3722

@netlify
Copy link

netlify bot commented Sep 13, 2022

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit 4710984
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/63203dfa5d397700081f04a4
😎 Deploy Preview https://deploy-preview-3732--compassionate-pike-271cb3.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.

@netlify
Copy link

netlify bot commented Sep 13, 2022

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit 418b3a7
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/632966152098b100081722a9
😎 Deploy Preview https://deploy-preview-3732--compassionate-pike-271cb3.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.

yaacovCR added a commit to yaacovCR/graphql-js that referenced this pull request Sep 13, 2022
@yaacovCR
Copy link
Contributor Author

Even if we don't take this solution in whole, we might want to extract out the removal of the unnecessary singleResult wrapper and just add that to #3722

This portion has been extracted out to #3733

yaacovCR added a commit to yaacovCR/graphql-js that referenced this pull request Sep 13, 2022
yaacovCR added a commit that referenced this pull request Sep 14, 2022
yaacovCR added a commit to yaacovCR/graphql-js that referenced this pull request Sep 20, 2022
@yaacovCR yaacovCR force-pushed the single-execute branch 2 times, most recently from 06b8284 to b4509cd Compare September 20, 2022 07:00
…ctives themselves

The use of new experimental functionality triggered by directives does not need a separate runtime flag. The directives themselves are the flags and all operations passed to `execute` are assumed to be valid.

Using TS conditional types, when new generic `TMaybeIncremental` parameter is set to true, return type of `execute` will be either an ExecutionResult or an IncrementalExecutionResultMap containing an `initialResult` and a generator of `subsequentResults`. While incremental delivery is designated as experimental, `TMaybeIncremental` will default to `false`. When incremental delivery is merged into the spec, it may be useful to adjust the default to `true`.
@yaacovCR
Copy link
Contributor Author

Closing in favor of #3722.

@yaacovCR yaacovCR closed this Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: breaking change 💥 implementation requires increase of "major" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant