graphql-js icon indicating copy to clipboard operation
graphql-js copied to clipboard

incrementalDelivery: use single execute function with directives as flags

Open yaacovCR opened this issue 3 years ago • 6 comments

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 avatar Sep 13 '22 08:09 yaacovCR

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

github-actions[bot] avatar Sep 13 '22 08:09 github-actions[bot]

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

yaacovCR avatar Sep 13 '22 08:09 yaacovCR

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

yaacovCR avatar Sep 13 '22 08:09 yaacovCR

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
Latest commit 471098405804639089a1d112152498693273f22e
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[bot] avatar Sep 13 '22 11:09 netlify[bot]

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
Latest commit 418b3a7a3f75ae87b239b492cc6adf4b54aa9628
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.

netlify[bot] avatar Sep 13 '22 11:09 netlify[bot]

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 avatar Sep 13 '22 13:09 yaacovCR

Closing in favor of #3722.

yaacovCR avatar Sep 28 '22 17:09 yaacovCR