Support composing directive argument default values - #312
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for composing directive argument default values in @theguild/federation-composition. Specifically, it updates the directive builder to preserve the defaultValue of directive arguments when they are defined, and includes a comprehensive integration test to verify this behavior. A changeset has also been added. I have no feedback to provide as the changes are clean and well-tested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
n1ru4l
left a comment
There was a problem hiding this comment.
✅ Approved with some additional comments!
The tests were not correctly asserting the default value behaviour as the assertions were raising errors due to other invalid subgraph conflicts.
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.23.2 ### Patch Changes - [#312](#312) [`32039b3`](32039b3) Thanks [@jdolle](https://github.com/jdolle)! - Support composing directive argument default values. E.g. ```graphql extend schema @link( url: "https://specs.apollo.dev/federation/v2.5" import: ["@key", "@composeDirective"] ) @link(url: "https://myspecs.dev/access/v1.0", import: ["@access"]) @composeDirective(name: "@access") directive @access(scope: Scope! = PUBLIC) on FIELD_DEFINITION enum Scope { PUBLIC PRIVATE } type Query { hello: String @access } ``` Previously, the "PUBLIC" default value in the above example would not be set in the composed result. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
closes #311