Skip to content

Conversation

@n1ru4l
Copy link
Contributor

@n1ru4l n1ru4l commented Dec 10, 2025

Prevent subgraph-specific federation types and scalars being re-declared within the subgraph leaking into the supergraph.

https://linear.app/the-guild/issue/CONSOLE-1643

@gemini-code-assist
Copy link

Summary of Changes

Hello @n1ru4l, 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 implements a crucial fix for the supergraph composition process, specifically addressing how the FieldSet scalar type is handled. Previously, if FieldSet was explicitly defined within a subgraph's schema, it would erroneously appear in the composed supergraph with an @join__type directive, suggesting it was an external type. The changes ensure that FieldSet is correctly recognized as an internal type in such scenarios, thereby preventing this unintended type leakage and maintaining the accuracy of the supergraph definition.

Highlights

  • Bug Fix: Resolves an issue where the FieldSet scalar type, when defined within a subgraph, was incorrectly marked as an external type in the composed supergraph schema.
  • New Test Case: Adds a new test to specifically validate that FieldSet does not 'leak' as an external type with a @join__type directive in the supergraph when it is defined internally within a subgraph.
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

@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 regression test to ensure that FieldSet defined in a subgraph does not leak into the supergraph. This is a valuable addition to prevent future regressions. The implementation of the test is solid, but I've noticed a minor typo in the test description that I've suggested a fix for.

@n1ru4l n1ru4l requested a review from kamilkisiela December 10, 2025 12:38
@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@theguild/federation-composition 0.21.1-alpha-20251210124939-35a8c2d57450dc168b6e786033480b8c5582bf90 npm ↗︎ unpkg ↗︎

@n1ru4l n1ru4l marked this pull request as ready for review December 10, 2025 12:39
@n1ru4l n1ru4l changed the title fix: leaked FieldSet on supergraph fix: leaked federation subgraph types on supergraph Dec 10, 2025
@n1ru4l n1ru4l requested a review from kamilkisiela December 10, 2025 12:46
@n1ru4l n1ru4l merged commit 2b34f17 into main Dec 10, 2025
4 checks passed
@n1ru4l n1ru4l deleted the fix-fieldset-leak-in-supergraph branch December 10, 2025 12:52
n1ru4l pushed a commit that referenced this pull request Dec 10, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @theguild/[email protected]

### Patch Changes

-
[#230](#230)
[`2b34f17`](2b34f17)
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Prevent subgraph-specific
federation types and scalars being re-declared within the subgraph
leaking into the supergraph.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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