Skip to content

Transformation support with Rust Query Planner Handler#1708

Merged
ardatan merged 13 commits intomainfrom
refactor-for-preparation-router
Nov 25, 2025
Merged

Transformation support with Rust Query Planner Handler#1708
ardatan merged 13 commits intomainfrom
refactor-for-preparation-router

Conversation

@ardatan
Copy link
Copy Markdown
Member

@ardatan ardatan commented Nov 19, 2025

  • Refactor transforms logic to make them generic
  • Handle transforms in router-handler package
  • Enable E2E tests related

@ardatan ardatan requested a review from enisdenjo November 19, 2025 16:45
@gemini-code-assist
Copy link
Copy Markdown
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 a significant refactoring of the GraphQL transformation logic, aiming to make it more generic and less coupled to specific stitching implementations. It overhauls the createRequest and delegateToSchema functions to streamline request generation and delegation, centralizing argument handling and enabling a more flexible application of transforms within the query planner. Key changes include improved enum projection, better access to subgraph configurations, and a more robust MoveRootField transform, ultimately enhancing the extensibility and maintainability of the GraphQL tools.

Highlights

  • Generic Transform Logic: The core logic for GraphQL transforms has been refactored to be more generic, reducing coupling to specific stitching implementations and improving overall flexibility.
  • createRequest Function Overhaul: The createRequest function in @graphql-tools/delegate has undergone breaking changes, simplifying its signature by removing several source-schema-related parameters and introducing a generic args map for argument handling.
  • delegateToSchema Enhancements: The delegateToSchema function now dynamically determines the target schema and handles fragments more generically, aligning with the new, more flexible transform approach.
  • Enum Projection Fix: An issue in @graphql-hive/router-runtime has been corrected to properly project listed enum values (e.g., [MyEnum!]!), ensuring accurate data representation.
  • Subgraph Access in Fusion Runtime: The @graphql-mesh/fusion-runtime package now exports a getSubgraph method, providing other handlers with direct access to extracted transforms and subgraph schemas.
  • Transform Application in Router Runtime: The @graphql-hive/router-runtime now applies transformRequest and transformResult hooks from subschema transforms during subgraph execution, enabling generic transforms within the query planner handler.
  • Centralized Argument Handling: Argument transformation logic previously scattered across various transform classes has been removed, indicating a move towards more centralized or automated handling within the delegation pipeline.
  • Improved MoveRootField Transform: The MoveRootField transform now accurately identifies and updates the operation type based on the transformed schema, enhancing its robustness and correctness.
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.

@ardatan ardatan force-pushed the refactor-for-preparation-router branch from 5fbdc6a to 9f81d18 Compare November 19, 2025 16:47
@ardatan ardatan enabled auto-merge (squash) November 19, 2025 16:51
Copy link
Copy Markdown
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 introduces a major refactoring to generalize schema transformations, enabling their use with the Rust-based query planner in the router runtime. This is a significant step towards a more unified and flexible architecture. The changes are extensive, touching delegation logic, request creation, and several transformation implementations. While the overall direction is excellent, I've identified a few critical issues related to this decoupling that could lead to runtime errors or incorrect behavior. My review focuses on these potential problems in argument processing, handling of conditional directives, and a potential crash in the MoveRootField transform.

Comment thread packages/wrap/src/transforms/MoveRootField.ts
Comment thread packages/delegate/src/createRequest.ts Outdated
Comment thread packages/delegate/src/finalizeGatewayRequest.ts Outdated
@theguild-bot
Copy link
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-tools/delegate 12.0.0-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-tools/federation 4.2.4-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-mesh/fusion-runtime 1.6.0-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 2.1.20-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.25-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 2.0.18-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-opentelemetry 1.2.2-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 2.1.6-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/router-runtime 1.1.0-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 2.3.6-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-tools/stitch 10.1.4-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-tools/stitching-directives 4.0.6-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-testing 2.0.6-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎
@graphql-tools/wrap 11.1.0-alpha-e23b844282b3244e6da4dc25307e1bdb5e3aeb88 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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-e23b844282b3244e6da4dc25307e1bdb5e3aeb88

@theguild-bot
Copy link
Copy Markdown
Collaborator

theguild-bot commented Nov 19, 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-e23b844282b3244e6da4dc25307e1bdb5e3aeb88-bun

@ardatan ardatan force-pushed the refactor-for-preparation-router branch 2 times, most recently from 9e7f51e to 818c840 Compare November 25, 2025 12:50
@ardatan ardatan force-pushed the refactor-for-preparation-router branch from 36b3cfa to c7ed703 Compare November 25, 2025 13:18
@ardatan ardatan disabled auto-merge November 25, 2025 13:26
@ardatan ardatan merged commit bc6cddd into main Nov 25, 2025
41 of 42 checks passed
@ardatan ardatan deleted the refactor-for-preparation-router branch November 25, 2025 13:27
ardatan added a commit to graphql-hive/console that referenced this pull request Jan 20, 2026
Tolsee added a commit to Tolsee/gateway that referenced this pull request Feb 13, 2026
…raphql-hive#1708

createRequest no longer preserves defaultValue on variable definitions
used in @include/@Skip directives, causing subgraph validation to reject
queries like `$flag: Boolean = false` in `Boolean!` positions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ardatan added a commit that referenced this pull request Feb 13, 2026
…1708 (#1948)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
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.

2 participants