Conversation
Summary of ChangesHello @kamilkisiela, 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 refines the GraphQL Federation composition logic to better handle the interplay between the Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
7c4d76b to
e101e07
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces significant improvements to the handling of @override and @requires directives in federation composition. The changes correctly prune stale external annotations and @join__type directives when a field with @requires is overridden. Additionally, a new validation rule is added to prevent progressive overrides on fields that have @requires in their source. The implementation is robust and well-tested.
I've identified a couple of areas where the logic could be extended to also cover interface types, ensuring complete correctness for all scenarios involving these directives. My review includes suggestions to address these points.
|
mergetto, mi compadre |
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/federation-composition@0.22.0 ### Minor Changes - [#267](#267) [`3e232fa`](3e232fa) Thanks [@kamilkisiela](https://github.com/kamilkisiela)! - Fix supergraph `@join__field` generation for `@override` + `@requires` migrations and add a progressive override restriction. When a field with `@requires` is overridden, composition now ignores `@requires` usage coming only from the overridden source field when deciding whether to keep `@join__field(..., external: true)`. This prevents stale external annotations in the supergraph. Also, progressive override (`@override(..., label: ...)`) is now rejected when the overridden source field uses `@requires` (error code: `OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE`). Non-progressive override behavior is unchanged. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Fix supergraph
@join__fieldgeneration for@override+@requirescombinations and add a progressive override restriction.When a field with
@requiresis overridden, composition now ignores@requiresusage coming only from the overridden source field when deciding whether to keep@join__field(..., external: true)or not.This prevents stale external annotations in the supergraph, that breaks Apollo's Query Planning related logic - Apollo Gateway sees
@externalfield that is not used by any@requiresand throws.Also, progressive override (
@override(..., label: ...)) is now rejected when the overridden source field uses@requires(error code:OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE). Non-progressive override behavior is unchanged.