-
Notifications
You must be signed in to change notification settings - Fork 575
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
feat: [server] Add new onOperation
hook
#3734
Conversation
🦋 Changeset detectedLatest commit: cdeb918 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Apollo Federation Subgraph Compatibility Results
Learn more: |
💻 Website PreviewThe latest changes are available as preview in: https://22b6d47b.graphql-yoga.pages.dev |
✅ Benchmark Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned about other hooks like onExecutionResult and onParams with this hook. But I think it is ok since we will use this to wrap the logic.
Should we also document this?
Yes, we can add a note about this fact, and that the recommended usage is for wrapping. The behavior is also coherent with |
Closed in favor of #3736 |
This PR introduces a new hook
onOperation
which is called for each operation to handle.The main purpose of this hook is to customize the graphql operation handling function.
For example, one will be able to wrap the entire graphql execution to give an access to an
AsyncLocalStorage
context:Fixes YOGA-2