Skip to content

fix: handle leftovers recursively async#1743

Merged
ardatan merged 2 commits intomainfrom
handle-deferred
Dec 1, 2025
Merged

fix: handle leftovers recursively async#1743
ardatan merged 2 commits intomainfrom
handle-deferred

Conversation

@ardatan
Copy link
Member

@ardatan ardatan commented Nov 29, 2025

This fixes requires-circular failure on audit repository
Weirdly this case was already passing here while failing in the upstream repo

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 introduces an asynchronous execution mechanism for handling leftover fields within the defaultMergedResolver. By deferring the handleLeftOver function using setImmediate, the change effectively resolves a specific bug related to circular @requires dependencies, ensuring proper test execution in the audit repository.

Highlights

  • Asynchronous Leftover Handling: The defaultMergedResolver now handles leftover fields asynchronously by wrapping the handleLeftOver function call in setImmediate. This change specifically addresses scenarios involving circular @requires dependencies.
  • Bug Fix: This pull request resolves a requires-circular test failure in the audit repository, which was previously observed to be failing upstream.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a circular dependency issue by making a recursive call to handleLeftOver asynchronous using setImmediate. This is a good approach to prevent stack overflow errors. However, my review points out a potential portability issue with using setImmediate, as it is a Node.js-specific API, and suggests using setTimeout(..., 0) for better cross-environment compatibility.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-tools/batch-delegate 10.0.6-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 12.0.0-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-tools/federation 4.2.4-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 1.6.0-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 2.1.20-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.25-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 2.0.18-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.2.2-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.1.6-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/router-runtime 1.1.0-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 2.3.6-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 10.1.4-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 4.0.6-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-testing 2.0.6-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 11.1.0-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7 npm ↗︎ unpkg ↗︎

@ardatan ardatan enabled auto-merge (squash) November 29, 2025 18:46
@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.20-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 29, 2025

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.1.20-alpha-9ffa8618e82774af879eab5dd71e0fd222e96cb7

@ardatan ardatan merged commit b520eb2 into main Dec 1, 2025
77 checks passed
@ardatan ardatan deleted the handle-deferred branch December 1, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants