Add internal directive support to Fusion schema types - #10122
Merged
Conversation
Contributor
Patch coverage94.8% of changed lines covered (219/231)
Uncovered changed lines (JSON){
"sha": "bda4258f2e2f00b7d06cfcfb566b467eb411dc5d",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirective.cs", "ranges": [[25, 27]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs", "ranges": [[145, 147]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution.Types/Collections/FusionDirectiveCollection.cs", "ranges": [[85, 85], [351, 351], [388, 388], [405, 407]] }
]
}Project coverage: 53.8% (231057/429810 lines) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class handling for “internal” directive applications in Fusion schema types, with special handling to normalize composed @fusion__tag into a public @tag directive definition while keeping tag applications optionally hidden from the default directive view.
Changes:
- Normalize composed
@fusion__tagdirective definitions to@tagand map@fusion__tagapplications to internal@tagapplications during schema completion. - Introduce internal/public partitioning for
FusionDirectiveCollection(default view shows only public directives;WithInternalsexposes all). - Add test coverage for tag normalization/visibility and directive collection partition semantics.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Types/FusionTagDirectiveTests.cs | Adds end-to-end tests validating tag normalization and internal/public visibility across schema elements. |
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Types/FusionDirectiveCollectionTests.cs | Adds unit tests validating stable partitioning and API behavior for directive collections with internals. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs | Adds support for directives applied to directive definitions and completion-time sealing. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirective.cs | Adds per-application visibility (IsPublic) and constructor overload to support internal directives. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionBuiltIns.cs | Adds fusion__tag built-in name constant. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Directives/DirectiveTools.cs | Stops filtering out fusion__tag so it can be retained and normalized. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/CompositeSchemaBuilder.cs | Preserves/normalizes fusion__tag directive definitions into tag and completes directive-definition directives. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/CompletionTools.cs | Maps fusion__tag applications to internal tag applications when building directive collections. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Collections/FusionDirectiveCollection.cs | Implements public/internal partitioning, adds WithInternals view, and updates collection semantics accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
+76
| public IEnumerable<FusionDirective> AsEnumerable() | ||
| => _publicCount == _directives.Length | ||
| ? _directives | ||
| : EnumerateDirectives(_directives, _publicCount); | ||
|
|
Comment on lines
+14
to
+18
| [Fact] | ||
| public void Create_Should_LoadPrivateTagsAsInternalTagDirectives_When_UsingDefaultMergeBehavior() | ||
| { | ||
| var schema = ComposeAndLoadSchema(); | ||
| var tagDefinition = schema.DirectiveDefinitions["tag"]; |
This was referenced Jul 23, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Aug 10, 2026
Open
Open
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.
No description provided.