[Fusion] Support directive-definition deprecation and location - #10027
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support in Fusion gateway introspection for directive definitions that (1) target DIRECTIVE_DEFINITION and (2) participate in deprecation metadata, bringing Fusion’s introspection surface closer to single-server HotChocolate behavior.
Changes:
- Extend introspection schema/resolvers to include
DIRECTIVE_DEFINITIONin__DirectiveLocationand handle it in__Directive.locations. - Add directive-definition deprecation metadata (
isDeprecated/deprecationReason) to__Directiveand honorincludeDeprecatedon__Schema.directives. - Extend
FusionDirectiveDefinitionto carry deprecation info (new ctor overload +[Obsolete]old ctor) and parse@deprecatedon directive definitions during schema completion.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Introspection/DirectiveDefinitionIntrospectionTests.cs | Adds a gateway introspection test exercising DIRECTIVE_DEFINITION and new directive deprecation fields. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Schema.cs | Updates __Schema.directives resolvers to support includeDeprecated filtering. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__DirectiveLocation.cs | Adds DIRECTIVE_DEFINITION enum string constant. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Directive.cs | Exposes isDeprecated/deprecationReason and adds DIRECTIVE_DEFINITION location mapping. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs | Adds deprecation properties and constructor overload; marks old ctor obsolete. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/IntrospectionSchema.cs | Updates introspection SDL to add new fields/args and DIRECTIVE_DEFINITION. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/CompositeSchemaContext.cs | Updates built-in directive definitions to use the new deprecation-aware constructor. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/Completion/CompositeSchemaBuilder.cs | Parses @deprecated on directive definitions and populates FusionDirectiveDefinition deprecation metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage77.2% of changed lines covered (61/79)
Uncovered changed lines (JSON){
"sha": "71d150fdb269c1f48e58fe6fdedb56fcc49b83b0",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionDirectiveDefinition.cs", "ranges": [[26, 35]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Introspection/__Schema.cs", "ranges": [[117, 118], [122, 124], [145, 146], [156, 156]] }
]
}Project coverage: 52.5% (217015/413212 lines) |
This was referenced Jul 7, 2026
This was referenced Jul 14, 2026
This was referenced Jul 23, 2026
This was referenced Jul 26, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 3, 2026
This was referenced Aug 11, 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.
Summary
DIRECTIVE_DEFINITIONdirective location (added to the__DirectiveLocationenum, the location constants, and the__Directive.locationsresolver), so a directive that targets directive definitions (for example@requiresOptIn) is introspected correctly instead of failing the resolver.FusionDirectiveDefinitioncarriesIsDeprecated/DeprecationReason(parsed from@deprecated),__DirectiveexposesisDeprecated/deprecationReason, and__Schema.directiveshonorsincludeDeprecated.FusionDirectiveDefinitionconstructor is retained and marked[Obsolete]so existing callers keep compiling.Test plan
DIRECTIVE_DEFINITIONis introspected with that location, and theisDeprecated/deprecationReasonfields resolve for every directive.Fusion.Execution.Testspasses (2308/0).