Skip to content

Conversation

@dotansimha
Copy link
Member

The consumer-facing schema was missing filtering for enum core__Purpose, directive @core, and directive @join_owner. This caused introspection errors due to failure to find other associated types.

@gemini-code-assist
Copy link
Contributor

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 addresses critical introspection resolution errors that occurred because the consumer-facing schema was not fully filtering out certain internal GraphQL elements. Specifically, enum core__Purpose, directive @core, and directive @join_owner were inadvertently exposed, leading to failures in type resolution during introspection. The changes ensure these internal components are correctly stripped, thereby stabilizing schema introspection and preventing related errors.

Highlights

  • Introspection Error Fix: Resolved introspection resolution errors in the consumer-facing schema by ensuring proper filtering of previously missed internal schema elements.
  • Schema Internal Stripping: Updated the StripSchemaInternals logic to correctly identify and remove enum core__Purpose, directive @core, and directive @join_owner from the consumer schema.
  • New Directive Definition: Introduced a new JoinOwnerDirective structure and module to properly handle the @join_owner directive within the federation specification.
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.

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 addresses an introspection error by adding missing filters for federation-specific schema elements. The changes are logical and well-implemented. I've pointed out a leftover debugging statement that should be removed and suggested a minor code simplification for better readability.

@github-actions
Copy link

github-actions bot commented Oct 26, 2025

k6-benchmark results

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

     █ setup

     checks.........................: 100.00% ✓ 209544      ✗ 0    
     data_received..................: 6.1 GB  204 MB/s
     data_sent......................: 82 MB   2.7 MB/s
     http_req_blocked...............: avg=3.17µs   min=721ns   med=1.78µs  max=20.66ms  p(90)=2.5µs   p(95)=2.87µs  
     http_req_connecting............: avg=387ns    min=0s      med=0s      max=1.4ms    p(90)=0s      p(95)=0s      
     http_req_duration..............: avg=21.04ms  min=2.12ms  med=19.95ms max=249.62ms p(90)=28.86ms p(95)=32.34ms 
       { expected_response:true }...: avg=21.04ms  min=2.12ms  med=19.95ms max=249.62ms p(90)=28.86ms p(95)=32.34ms 
     http_req_failed................: 0.00%   ✓ 0           ✗ 69868
     http_req_receiving.............: avg=186.79µs min=24.11µs med=40.01µs max=206.98ms p(90)=95.96µs p(95)=425.61µs
     http_req_sending...............: avg=25.06µs  min=5.4µs   med=10.81µs max=24.54ms  p(90)=15.7µs  p(95)=27.98µs 
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s      max=0s       p(90)=0s      p(95)=0s      
     http_req_waiting...............: avg=20.83ms  min=2.07ms  med=19.81ms max=71.76ms  p(90)=28.59ms p(95)=32.01ms 
     http_reqs......................: 69868   2324.040619/s
     iteration_duration.............: avg=21.46ms  min=6.36ms  med=20.3ms  max=280.08ms p(90)=29.32ms p(95)=32.85ms 
     iterations.....................: 69848   2323.375352/s
     vus............................: 50      min=50        max=50 
     vus_max........................: 50      min=50        max=50 

@github-actions
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-526 ghcr.io/graphql-hive/router:sha-78a3864

Docker metadata
{
"buildx.build.ref": "builder-6103cb8a-9c9b-4b38-bdf6-6f16336b8e37/builder-6103cb8a-9c9b-4b38-bdf6-6f16336b8e370/j5lnpjjxsubpo1ejek83coeoa",
"containerimage.descriptor": {
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "digest": "sha256:61332a10238cdb08155cbc9850a59b524eee90912ac5304f63d7f8ca3e6c22f0",
  "size": 1609
},
"containerimage.digest": "sha256:61332a10238cdb08155cbc9850a59b524eee90912ac5304f63d7f8ca3e6c22f0",
"image.name": "ghcr.io/graphql-hive/router:pr-526,ghcr.io/graphql-hive/router:sha-78a3864"
}

Copy link
Member

@ardatan ardatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should add some tests to make sure the supergraph variant that has core__x definitions?

@kamilkisiela kamilkisiela changed the title fix(query-planner, router): fix introspection resolve error due to partial filtering fix(query-planner, router): fix introspection for federation v1 supergraph Oct 27, 2025
@kamilkisiela kamilkisiela merged commit 6ae8c6d into main Oct 27, 2025
18 checks passed
@kamilkisiela kamilkisiela deleted the fix-consumer-schema branch October 27, 2025 08:53
This was referenced Oct 27, 2025
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.

4 participants