Skip to content

Conversation

@ardatan
Copy link
Member

@ardatan ardatan commented Nov 25, 2025

Hive Router QP no longer adds extra query prefix to the anonymous queries.
This package updates snapshots and tests based on that, and also it aligns stitching with the qp by removing extra __typename selections

@ardatan ardatan requested a review from enisdenjo November 25, 2025 12:42
@gemini-code-assist
Copy link

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 primarily focuses on integrating an updated version of the Hive Router Query Planner, which streamlines how anonymous GraphQL queries are handled by removing redundant query prefixes. Concurrently, it optimizes GraphQL stitching to prevent unnecessary __typename selections at the root level. These changes lead to cleaner generated queries and more efficient processing, with corresponding updates to tests and snapshots across the codebase to ensure compatibility and correctness.

Highlights

  • Router Query Planner Update: The core @graphql-hive/router-query-planner package has been updated to version 0.0.4. This update changes how anonymous GraphQL queries are processed, specifically by no longer adding an extra query prefix.
  • __typename Selection Optimization: GraphQL stitching logic has been refined to avoid adding an extra __typename field to root selections unless explicitly necessary (i.e., when a root type has nested fields of the same root type).
  • Test and Snapshot Alignment: Numerous tests and snapshots across various packages (batch-execute, delegate, federation, plugins, runtime) have been updated to reflect the new query planning behavior and the optimized __typename selection.
  • Gateway Request Validation: The delegation logic now includes a check to prevent the creation of empty gateway requests by ensuring that an operation has at least one selection.
  • Heap Snapshot Test Skipping: Added an environment variable SKIP_HEAPSNAPSHOT_TESTS to allow conditionally skipping heap snapshot performance tests.
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 enabled auto-merge (squash) November 25, 2025 12:44
@theguild-bot
Copy link
Collaborator

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

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 25, 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 25, 2025

🚀 Snapshot Release (Binary for Linux-X64)

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

Download

Copy link

@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 bumps the @graphql-hive/router-query-planner package and adapts the codebase to its new behavior. The changes, which include removing the query prefix from anonymous queries and avoiding extra __typename selections, are consistently applied across tests and snapshots. The logic modification in packages/stitch/src/stitchingInfo.ts to conditionally add __typename only for nested root types is a solid optimization. I have one minor suggestion to further refine the code in that file. Overall, the pull request is well-executed and aligns with its objectives.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 25, 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 25, 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 25, 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-cb5d74178ac278a8dff9f3c28389cd01c854c121-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 25, 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-cb5d74178ac278a8dff9f3c28389cd01c854c121

@theguild-bot
Copy link
Collaborator

theguild-bot commented Nov 25, 2025

🚀 Snapshot Release (Binary for Windows-X64)

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

Download

@ardatan ardatan disabled auto-merge November 25, 2025 13:15
@ardatan ardatan merged commit 1dbc653 into main Nov 25, 2025
42 checks passed
@ardatan ardatan deleted the bump-router branch November 25, 2025 13:16
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