Skip to content

reproduction to showcase a bug in combing an @requires with the __typename of a union#247

Merged
kamilkisiela merged 1 commit intographql-hive:kamil-requires-typename-unionfrom
rickbijkerk:feature/union-requires-failure
Jan 15, 2026
Merged

reproduction to showcase a bug in combing an @requires with the __typename of a union#247
kamilkisiela merged 1 commit intographql-hive:kamil-requires-typename-unionfrom
rickbijkerk:feature/union-requires-failure

Conversation

@rickbijkerk
Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @rickbijkerk, 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 new test case designed to reproduce a specific bug within GraphQL Federation's composition logic. The test highlights an incompatibility or unexpected behavior when the @requires directive is used in conjunction with the __typename field of a union type. By providing a clear, isolated scenario, this change aims to facilitate debugging and validation of a fix for this particular federation composition issue.

Highlights

  • New Test Case Added: A new test case has been introduced in __tests__/composition.spec.ts to specifically reproduce and showcase a bug related to GraphQL Federation composition.
  • Bug Reproduction: The test case demonstrates an issue where combining the @requires directive with the __typename field of a union type (Description in this case) leads to a composition failure, which the test expects to succeed.
  • Federation Setup: The reproduction involves two federated services, 'a' and 'b', where service 'b' defines a calculatedField on a Product type that @requires the description union field, including its __typename and specific fields from its DescriptionLong and DescriptionShort variants.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Copy Markdown
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 adds a new test case to reproduce a bug related to using @requires with a union's __typename. The changes are clear and focused. I've provided a few suggestions to improve code quality and consistency.

@kamilkisiela kamilkisiela changed the base branch from main to kamil-requires-typename-union January 15, 2026 13:15
@kamilkisiela kamilkisiela merged commit 661ccbc into graphql-hive:kamil-requires-typename-union Jan 15, 2026
3 of 4 checks passed
kamilkisiela pushed a commit that referenced this pull request Jan 15, 2026
…ename of a union (#247)

Co-authored-by: Rick Bijkerk <rickbijkerk@bol.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