fix: @requires with __typename on a union#248
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 introduces a new test case to ensure the stability and correctness of GraphQL Federation composition logic. It specifically targets a scenario involving 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 adds a new test case to verify that @requires with __typename on a union type works correctly. The test itself is a good addition. My feedback includes suggestions to improve the test's clarity and maintainability by renaming the test, removing hardcoded versions, and fixing some formatting issues in the GraphQL schema strings.
…ename of a union (#247) Co-authored-by: Rick Bijkerk <rickbijkerk@bol.com>
Allow selecting __typename on union types by validating access to each member type and returning the first member lacking access. Continue to throw for non-__typename field selections on unions. Update tests and use the version variable in federation spec URLs.
b7d8b42 to
9555df1
Compare
n1ru4l
left a comment
There was a problem hiding this comment.
Looking good but needs a changeset ![]()
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.3 ### Patch Changes - [#248](#248) [`9535d50`](9535d50) Thanks [@kamilkisiela](https://github.com/kamilkisiela)! - Fix access validation on union members when selecting `__typename` in `@requires` directives. The `@requires` directive validation rule (`AuthOnRequiresRule`) was not checking authorization requirements for `__typename` selections on and types. When `__typename` on a union type was selected, code would throw an unexpected error. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

No description provided.