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

introduce ValidatedExecutionArgs #4210

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Oct 1, 2024

to safely export buildExecutionContext() as validateExecutionArgs()

motivation: this will allow us to:

  1. export executeOperation() and executeSubscription() for those who would like to use directly.
  2. add a perEventExecutor option to ExecutionArgs that allows one to pass a custom context for execution of each execution event, with the opportunity to clean up the context on return, a la Fix #894, add perEventContextResolver for subscribe #2485 and feat(subscribe): allow providing custom execute function for subscribe #3071, addressing Context lifecycle in subscriptions #894, which would not require re-coercion of variables.

The signature of the perEventExecutor option would be:

type SubscriptionEventExecutor = ( validatedExecutionArgs: ValidatedExecutionArgs): PromiseOrValue<ExecutionResult>

rather than:

type SubscriptionEventExecutor = ( executionArgs: ExecutionArgs): PromiseOrValue<ExecutionResult>

This might be a first step to integrating subscribe() completely into execute() (see: #3644) but is also a reasonable stopping place.

@yaacovCR yaacovCR requested a review from a team as a code owner October 1, 2024 08:55
Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit 92df852
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/66fbbaf0a9d4a90008d79e9d
😎 Deploy Preview https://deploy-preview-4210--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 configuration.

Copy link

github-actions bot commented Oct 1, 2024

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 yaacovCR requested a review from JoviDeCroock October 1, 2024 09:04
@yaacovCR
Copy link
Contributor Author

yaacovCR commented Oct 1, 2024

added motivation above.

@yaacovCR yaacovCR merged commit a1d22a2 into graphql:main Oct 1, 2024
20 checks passed
@yaacovCR yaacovCR deleted the validated-execution-args branch October 1, 2024 18:29
@yaacovCR yaacovCR added the PR: feature 🚀 requires increase of "minor" version number label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature 🚀 requires increase of "minor" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants