fix(validation): Correctly validate @key on interface implementations#241
fix(validation): Correctly validate @key on interface implementations#241
Conversation
implementation The validation for INTERFACE_KEY_NOT_ON_IMPLEMENTATION was incorrectly checking all types that implement an interface with a @key directive, including other interfaces. This change ensures that the validation is only applied to object types, which are the actual implementations that need to satisfy the @key requirement. This fixes cases where an interface implements another keyed interface, which should not trigger a validation error.
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 resolves an issue in the subgraph validation process concerning the Highlights
🧠 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 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
|
There was a problem hiding this comment.
Code Review
This pull request addresses a bug in the validation logic for the @key directive on interfaces. The fix correctly ensures that the validation rule INTERFACE_KEY_NOT_ON_IMPLEMENTATION is only applied to object types that implement an interface with @key, and not to other interfaces in the implementation chain. The change is simple, effective, and is accompanied by a new test case that properly validates the corrected behavior. The code quality is good, and I have no further suggestions for improvement.
|
mergitto, mi amore? |
|
danke |
|
全然いいよ |
|
Żabka |
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.21.2 ### Patch Changes - [#241](#241) [`c6e26ed`](c6e26ed) Thanks [@kamilkisiela](https://github.com/kamilkisiela)! - Fixes a bug in `@key` directive validation where an error was incorrectly reported for interfaces implementing another interface with a `@key`. The validation now correctly applies only to object types implementing the interface. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR fixes an issue in the subgraph validation logic for the
@keydirective on interfaces. Previously, theINTERFACE_KEY_NOT_ON_IMPLEMENTATIONvalidation error was incorrectly triggered when an interface implemented another interface that had a@keydirective.The validation rule should only enforce that object types implementing an interface with
@keyalso have the same@key. It should not apply to other interfaces that are part of the implementation chain.