Skip to content

Conversation

@enisdenjo
Copy link
Member

@enisdenjo enisdenjo commented Dec 8, 2025

The shippingEstimate was always returning null even though it should not. Could lead to false-negatives in tests.

https://async-graphql.github.io/async-graphql/en/apollo_federation.html#requires

P.S. Fixed in benchmarks repo too graphql-hive/graphql-gateways-benchmark#894.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @enisdenjo, 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 addresses an issue where external fields of federated entities, such as price and weight for Product entities, were not being correctly populated within the E2E inventory subgraph. This oversight resulted in dependent fields like shippingEstimate consistently returning null. The changes ensure that these external fields are properly handled and passed to the entity resolver, allowing for accurate computation and return of derived fields, as validated by updated E2E test assertions.

Highlights

  • Federated Entity Field Population: The find_product_by_id resolver in the inventory subgraph has been updated to correctly populate external fields, specifically price and weight, for federated Product entities.
  • Shipping Estimate Fix: The shippingEstimate field, which was previously always returning null, now correctly reflects calculated values in the E2E tests, demonstrating that the external fields are being properly utilized.
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.

@enisdenjo enisdenjo changed the title Populate entity's external fields in E2E inventory subgraph chore(e2e): Populate entity's external fields in E2E inventory subgraph Dec 8, 2025
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 correctly populates the external price and weight fields in the inventory subgraph's entity resolver. This fixes an issue where shippingEstimate was always null in E2E tests, which could lead to false negatives. The changes to the test snapshots reflect this fix. I've added one suggestion to improve the robustness of the entity resolver in bench/subgraphs/inventory.rs by handling cases where a product might not be found, preventing potential panics during tests.

@enisdenjo enisdenjo changed the title chore(e2e): Populate entity's external fields in E2E inventory subgraph test: Populate entity's external fields in E2E inventory subgraph Dec 8, 2025
@enisdenjo enisdenjo marked this pull request as draft December 8, 2025 13:16
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

k6-benchmark results

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

     █ setup

     checks.........................: 100.00% ✓ 206886      ✗ 0    
     data_received..................: 6.0 GB  201 MB/s
     data_sent......................: 81 MB   2.7 MB/s
     http_req_blocked...............: avg=3.63µs   min=661ns  med=1.68µs  max=28.63ms  p(90)=2.36µs  p(95)=2.72µs  
     http_req_connecting............: avg=847ns    min=0s     med=0s      max=2.54ms   p(90)=0s      p(95)=0s      
     http_req_duration..............: avg=21.32ms  min=2.2ms  med=20.28ms max=246.29ms p(90)=28.93ms p(95)=32.21ms 
       { expected_response:true }...: avg=21.32ms  min=2.2ms  med=20.28ms max=246.29ms p(90)=28.93ms p(95)=32.21ms 
     http_req_failed................: 0.00%   ✓ 0           ✗ 68982
     http_req_receiving.............: avg=199.35µs min=25.3µs med=39.28µs max=211.56ms p(90)=93.67µs p(95)=410.65µs
     http_req_sending...............: avg=28.12µs  min=5.36µs med=10.64µs max=110.04ms p(90)=15.86µs p(95)=28.68µs 
     http_req_tls_handshaking.......: avg=0s       min=0s     med=0s      max=0s       p(90)=0s      p(95)=0s      
     http_req_waiting...............: avg=21.09ms  min=2.14ms med=20.13ms max=59.11ms  p(90)=28.71ms p(95)=31.82ms 
     http_reqs......................: 68982   2293.909105/s
     iteration_duration.............: avg=21.75ms  min=7.55ms med=20.64ms max=262.11ms p(90)=29.4ms  p(95)=32.72ms 
     iterations.....................: 68962   2293.24403/s
     vus............................: 50      min=50        max=50 
     vus_max........................: 50      min=50        max=50 

@github-actions
Copy link

github-actions bot commented Dec 8, 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-603 ghcr.io/graphql-hive/router:sha-1cdb70e

Docker metadata
{
"buildx.build.ref": "builder-a44c9769-e1a1-4ea7-88b4-db50ffe8dcdb/builder-a44c9769-e1a1-4ea7-88b4-db50ffe8dcdb0/jx2pcr1jm4imd9fo9tpnu0y2p",
"containerimage.descriptor": {
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "digest": "sha256:331e918cafd443c836f712857c03280f4510dc77ff8f3bb3f3edb5f551d6be36",
  "size": 1609
},
"containerimage.digest": "sha256:331e918cafd443c836f712857c03280f4510dc77ff8f3bb3f3edb5f551d6be36",
"image.name": "ghcr.io/graphql-hive/router:pr-603,ghcr.io/graphql-hive/router:sha-1cdb70e"
}

@enisdenjo enisdenjo marked this pull request as ready for review December 8, 2025 14:01
@enisdenjo enisdenjo merged commit 7598052 into main Dec 8, 2025
20 checks passed
@enisdenjo enisdenjo deleted the actual-requires branch December 8, 2025 18:17
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