Skip to content

Conversation

dotansimha
Copy link
Member

No description provided.

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.

Summary of Changes

Hello @dotansimha, 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 new capability to the gateway by exposing its GraphQL query planning functionality over HTTP. The primary goal is to allow external systems or debugging tools to interact directly with the gateway's planner, enabling them to retrieve supergraph metadata (version and schema) and, crucially, to request a query plan for any given GraphQL operation. This change modularizes the planner's HTTP interface and enhances the gateway's shared state to support these new endpoints, laying the groundwork for more advanced introspection and integration.

Highlights

  • New Planner Service Module: A new Rust module, planner_service, has been introduced to encapsulate the logic for exposing the GraphQL query planner over HTTP.
  • New HTTP Endpoints for Planner: The gateway now exposes three new HTTP endpoints: /supergraph/version for retrieving the supergraph's version, /supergraph/schema for its SDL, and /build-query-plan for generating a query plan from a given GraphQL operation.
  • Enhanced Gateway Shared State: The GatewaySharedState has been extended to store the supergraph version and its SDL string, making this information readily available to the new HTTP handlers.
  • Comprehensive Query Plan Generation: The /build-query-plan endpoint handles the full lifecycle of a GraphQL operation for planning purposes, including parsing, validation against the consumer schema, normalization, and generating a detailed query plan.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 introduces a planner service over HTTP, which is a valuable addition for debugging and integration purposes. The implementation is largely well-structured. I've identified a critical issue related to random number generation that would prevent compilation, a redundant Axum layer that can be removed for clarity, and a couple of performance improvements using Arc<String> to avoid expensive cloning of the schema SDL. My detailed comments are below.

Copy link

k6-benchmark results

     ✓ response code was 200
     ✓ no graphql errors
     ✓ valid response structure

     █ setup

     checks.........................: 100.00% ✓ 108702      ✗ 0    
     data_received..................: 3.2 GB  106 MB/s
     data_sent......................: 43 MB   1.4 MB/s
     http_req_blocked...............: avg=19.93µs  min=832ns   med=2.07µs  max=144.44ms p(90)=3.1µs    p(95)=3.65µs  
     http_req_connecting............: avg=11.76µs  min=0s      med=0s      max=144.38ms p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=40.29ms  min=1.98ms  med=38.35ms max=176.07ms p(90)=54.1ms   p(95)=61.02ms 
       { expected_response:true }...: avg=40.29ms  min=1.98ms  med=38.35ms max=176.07ms p(90)=54.1ms   p(95)=61.02ms 
     http_req_failed................: 0.00%   ✓ 0           ✗ 36254
     http_req_receiving.............: avg=236.64µs min=31.6µs  med=46.29µs max=42.71ms  p(90)=170.17µs p(95)=490.54µs
     http_req_sending...............: avg=110µs    min=6.46µs  med=12.14µs max=117.91ms p(90)=20.83µs  p(95)=137.15µs
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s      max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=39.95ms  min=1.91ms  med=38.08ms max=172.29ms p(90)=53.55ms  p(95)=60.3ms  
     http_reqs......................: 36254   1205.549247/s
     iteration_duration.............: avg=41.39ms  min=10.71ms med=38.97ms max=455.34ms p(90)=54.9ms   p(95)=61.82ms 
     iterations.....................: 36234   1204.88419/s
     vus............................: 50      min=50        max=50 
     vus_max........................: 50      min=50        max=50 

Copy link

🐋 This PR was built and pushed to the following Docker images:

Image Names: ghcr.io/graphql-hive/router

Platforms: linux/amd64,linux/arm64

Image Tags: ghcr.io/graphql-hive/router:pr-349 ghcr.io/graphql-hive/router:sha-28fae1e

Docker metadata
{
"buildx.build.ref": "builder-df6adc43-ee81-4b1a-a783-7a0969fce634/builder-df6adc43-ee81-4b1a-a783-7a0969fce6340/lo4b7vmu8gn840quwgyjg1q1f",
"containerimage.descriptor": {
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "digest": "sha256:b49c410e5bc25d7728a3d8941a9c67ff6cbe1b0383461ae14703fa6df6d95713",
  "size": 1609
},
"containerimage.digest": "sha256:b49c410e5bc25d7728a3d8941a9c67ff6cbe1b0383461ae14703fa6df6d95713",
"image.name": "ghcr.io/graphql-hive/router:pr-349,ghcr.io/graphql-hive/router:sha-28fae1e"
}

@dotansimha dotansimha force-pushed the main branch 12 times, most recently from e9864f4 to a80cb5b Compare September 1, 2025 13:55
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.

1 participant