[Fusion] Add support for merging @specifiedBy directives#9307
Merged
Conversation
Contributor
Fusion Gateway Performance Results
Simple Composite Query
Response Times
Deep Recursion Query
Response Times
Variable Batching Throughput
Response Times
Runner 1 = benchmarking-1Run 22712753887 • Commit 72fc799 • Thu, 05 Mar 2026 10:05:55 GMT |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Fusion composition support for carrying @specifiedBy(url: ...) through scalar merging so the composed schema preserves scalar specification URLs.
Changes:
- Introduces a
SpecifiedByDirectiveMerger(+ parsing helper) and wires it into scalar type merging. - Fixes
CompositeSchemaBuilderto correctly read thespecifiedBydirective argument value node. - Updates composition resources and tests/snapshots to validate the merged output.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Mutable/src/Types.Mutable/BuiltIns/SpecifiedByMutableDirectiveDefinition.cs | Adds a schema-based factory for the mutable @specifiedBy directive definition. |
| src/HotChocolate/Mutable/src/Types.Mutable/BuiltIns/OneOfMutableDirectiveDefinition.cs | Minor signature tweak to avoid unused parameter warnings. |
| src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaMerger.Scalar.Tests.cs | Adds a snapshot test for merging scalars with @specifiedBy. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution.Types/Completion/CompositeSchemaBuilder.cs | Fixes extraction of the url argument from @specifiedBy. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/WellKnownDirectiveNames.cs | Adds SpecifiedBy constant. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/WellKnownArgumentNames.cs | Adds Url constant. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaMerger.cs | Registers and applies the SpecifiedByDirectiveMerger during scalar merging. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx | Adds localized error message for invalid url argument. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs | Designer update for new resource entry. |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Directives/SpecifiedByDirective.cs | Adds typed parsing for @specifiedBy(url: String!). |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/DirectiveMergers/SpecifiedByDirectiveMerger.cs | Implements merging of @specifiedBy onto merged scalar types. |
| src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/snapshots/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET10_0_Fusion.json | Snapshot update reflecting changed OpenAPI output. |
Files not reviewed (1)
- src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes (Less than 80 chars)
@specifiedBydirectives.