fix(batch-execute/signal): handle batched execution cancellation - #1928
fix(batch-execute/signal): handle batched execution cancellation#1928ardatan wants to merge 15 commits into
Conversation
4f3afb4 to
51263c0
Compare
Summary of ChangesHello @ardatan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves resource management for GraphQL batched requests by introducing a new Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new AbortSignal.all utility and integrates it into batched executions to allow for cancellation when all individual requests are aborted. The implementation is thoughtful, especially regarding memory management with WeakRef and FinalizationRegistry. My review focuses on a couple of documentation inconsistencies in the changeset files and a potential performance improvement in the new abortSignalAll function.
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-tools/batch-delegate |
10.0.18-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/batch-execute |
10.1.0-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/delegate |
12.0.12-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/executor-http |
3.1.2-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/federation |
4.3.1-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/fusion-runtime |
1.8.1-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway |
2.5.10-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/nestjs |
2.0.51-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-aws-sigv4 |
2.0.33-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/plugin-opentelemetry |
1.4.7-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
2.1.26-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/router-runtime |
1.2.1-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-runtime |
2.7.8-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/signal |
2.1.0-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitch |
10.1.16-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/stitching-directives |
4.0.18-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-testing |
6.0.8-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-common |
1.0.16-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http |
1.0.17-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-http-callback |
1.0.17-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/transport-ws |
2.0.17-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
@graphql-tools/wrap |
11.1.12-alpha-a9d40d9a3f2c4a1c7a7b1203779f9276711a2379 |
npm ↗︎ unpkg ↗︎ |
e0aaaf4 to
1f7e943
Compare
2dbb76f to
198e6bc
Compare
85ef635 to
089f88e
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
089f88e to
396d536
Compare
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
New utility
abortSignalAllWe have introduced a new utility function
abortSignalAllthat allows you to combine multipleAbortSignalinstances into a single signal. So, if all of the individual signals are aborted, the combined signal will also be aborted. This is particularly useful in scenarios such as batched GraphQL requests, where you may want to abort the entire batch if all individual requests are aborted.Execution cancellation on batched requests
When using Batched Execution, it is now possible to cancel the entire batched request if all individual requests'
AbortSignals are aborted. This enhancement improves resource management and responsiveness in applications that utilize batched GraphQL operations.Previously, aborting individual requests did not affect the batched request. With this update, if all individual requests signal an abort, the batched request will also be aborted, ensuring that unnecessary processing is avoided.
This feature is implemented using the new utility function
abortSignalAll, which combines multipleAbortSignalinstances into a single signal. If all of the requests are aborted, the combined signal will also be aborted.