Skip to content

Conversation

@ardatan
Copy link
Member

@ardatan ardatan commented Nov 14, 2025

Implements From the subgraph to the gateway part of #315

@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 a significant enhancement to the executor by enabling automatic decompression of responses from subgraphs. This change allows the system to efficiently handle compressed data, reducing network bandwidth and potentially improving response times, by automatically detecting and processing various compression formats advertised by subgraphs.

Highlights

  • Automatic Decompression: The executor now automatically detects and decompresses subgraph responses based on the Content-Encoding header, eliminating the need for manual handling of compressed data.
  • Supported Compression Algorithms: This feature supports a variety of common compression algorithms including Gzip, Deflate, Brotli, and Zstd, enhancing compatibility with diverse subgraph implementations.
  • Content Negotiation: The HTTPSubgraphExecutor now sends an Accept-Encoding header in requests, advertising support for gzip, deflate, br, and zstd to subgraphs, allowing them to respond with compressed data.
  • Robust Error Handling: New error types, UnknownEncoding and DecompressionFailed, have been introduced to provide clearer diagnostics when encountering unsupported encoding types or issues during the decompression process.
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 marked this pull request as draft November 14, 2025 13:50
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 automatic decompression of subgraph responses, which is a valuable feature. The implementation correctly adds the Accept-Encoding header and handles the Content-Encoding header in responses. However, I've identified a critical bug where decompression errors are silently ignored, which could lead to hard-to-debug issues. Additionally, there are a couple of high-severity error handling issues that obscure the root cause of failures. I've provided suggestions to fix these problems and a medium-severity comment to improve performance and readability in the new compression module.

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

k6-benchmark results

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

     █ setup

     checks.........................: 100.00% ✓ 208518      ✗ 0    
     data_received..................: 6.1 GB  203 MB/s
     data_sent......................: 82 MB   2.7 MB/s
     http_req_blocked...............: avg=3.64µs   min=701ns   med=1.83µs  max=4.92ms   p(90)=2.65µs  p(95)=3.08µs  
     http_req_connecting............: avg=998ns    min=0s      med=0s      max=2.44ms   p(90)=0s      p(95)=0s      
     http_req_duration..............: avg=21.09ms  min=2.58ms  med=20.14ms max=111.84ms p(90)=28.72ms p(95)=31.91ms 
       { expected_response:true }...: avg=21.09ms  min=2.58ms  med=20.14ms max=111.84ms p(90)=28.72ms p(95)=31.91ms 
     http_req_failed................: 0.00%   ✓ 0           ✗ 69526
     http_req_receiving.............: avg=142.79µs min=25.32µs med=41.39µs max=73.73ms  p(90)=90.48µs p(95)=410.86µs
     http_req_sending...............: avg=25.77µs  min=5.51µs  med=10.98µs max=18.36ms  p(90)=16.97µs p(95)=28.57µs 
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s      max=0s       p(90)=0s      p(95)=0s      
     http_req_waiting...............: avg=20.93ms  min=2.49ms  med=20ms    max=98.34ms  p(90)=28.46ms p(95)=31.57ms 
     http_reqs......................: 69526   2311.847973/s
     iteration_duration.............: avg=21.57ms  min=5.82ms  med=20.49ms max=249.22ms p(90)=29.2ms  p(95)=32.37ms 
     iterations.....................: 69506   2311.182941/s
     vus............................: 50      min=50        max=50 
     vus_max........................: 50      min=50        max=50 

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

🐋 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-568 ghcr.io/graphql-hive/router:sha-a744eac

Docker metadata
{
"buildx.build.ref": "builder-7b6ac8c3-7a0a-4ebf-a15c-5b8e0ea8d13d/builder-7b6ac8c3-7a0a-4ebf-a15c-5b8e0ea8d13d0/puyubmti6wlzt2rhfcik4o0q0",
"containerimage.descriptor": {
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "digest": "sha256:263b589ca1e250933d6bf376b3c2e6661ae535d7d22294c460f7a27fdfefeba0",
  "size": 1609
},
"containerimage.digest": "sha256:263b589ca1e250933d6bf376b3c2e6661ae535d7d22294c460f7a27fdfefeba0",
"image.name": "ghcr.io/graphql-hive/router:pr-568,ghcr.io/graphql-hive/router:sha-a744eac"
}

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