Repository navigation
Add appliedDirectives to __Directive introspection - #10143
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Hot Chocolate’s (non-spec) directive introspection support by adding appliedDirectives: [__AppliedDirective!]! to the __Directive introspection type, gated behind EnableDirectiveIntrospection, so directives applied to directive definitions can be introspected consistently with __Type, __Field, and __Schema.
Changes:
- Added
appliedDirectivesfield to__DirectivewhenEnableDirectiveIntrospectionis enabled, resolving to the directive definition’s applied directives. - Added a new regression test asserting applied directives on directive definitions round-trip through
__schema { directives { appliedDirectives ... } }. - Updated directive-introspection snapshots to account for the new
__Directive.appliedDirectivesfield (and added a new snapshot for the new test).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/HotChocolate/Core/src/Types/Types/Introspection/__Directive.cs |
Adds the gated appliedDirectives field to __Directive and resolves it from the directive definition’s applied directives, filtering to public directives like other applied-directive introspection resolvers. |
src/HotChocolate/Core/test/Execution.Tests/IntrospectionTests.cs |
Adds a test verifying applied directives on directive definitions are exposed when directive introspection is enabled. |
src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DirectiveIntrospection_SomeDirectives_Internal.snap |
Snapshot update reflecting the new __Directive.appliedDirectives field in directive introspection output. |
src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DirectiveIntrospection_AllDirectives_Public.snap |
Snapshot update reflecting the new __Directive.appliedDirectives field. |
src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DirectiveIntrospection_AllDirectives_Public_When_DisableInternalDirectives_Is_True.snap |
Snapshot update reflecting the new __Directive.appliedDirectives field. |
src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DirectiveIntrospection_AllDirectives_Internal.snap |
Snapshot update reflecting the new __Directive.appliedDirectives field. |
src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.AppliedDirectivesOnDirectiveDefinitionAreExposed.snap |
New snapshot for the new regression test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage100.0% of changed lines covered (11/11)
Project coverage: 53.8% (231700/430550 lines) |
This was referenced Aug 6, 2026
Merged
This was referenced Aug 13, 2026
Closed
Closed
This was referenced Aug 25, 2026
Closed
Closed
This was referenced Sep 7, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
This was referenced Oct 19, 2026
This was referenced Oct 26, 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
appliedDirectives: [__AppliedDirective!]!field to the__Directiveintrospection type, gated behind theEnableDirectiveIntrospectionschema option, so directives applied to a directive definition become introspectable.appliedDirectivesimplementations on__Type,__Field, and__Schema. Stays out of standard introspection because__AppliedDirectiveis a non-spec Hot Chocolate extension.Test plan
IntrospectionTests.AppliedDirectivesOnDirectiveDefinitionAreExposed: a directive definition carrying an applied directive round-trips through__schema { directives { appliedDirectives { name args { name value } } } }.IntrospectionTestssuite green (net10.0); regenerated the four directive-introspection snapshots that enumerate every type's fields.