Add inaccessible switch to global object identification options - #10381
Merged
Merged
Conversation
…erging re-adds the canonical node field
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Address the public interface compatibility, option-copy test coverage, and documentation corrections before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an opt-in ApplyInaccessibleToNodeFields option for generated Relay fields while preserving Fusion lookup behavior.
Changes:
- Adds and propagates the schema option.
- Applies
@inaccessibleand@shareabledirectives. - Preserves composition and entity resolution behavior.
- Adds documentation, tests, and snapshots.
File summaries
| File | Summary |
|---|---|
website/content/docs/fusion/entities-and-lookups.md |
Documents the new option and generated fields. |
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SourceSchemaMerger.GlobalObjectIdentification.Tests.cs |
Tests inaccessible node-field composition. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/InaccessibleTests.cs |
Tests gateway introspection, rejection, and entity resolution. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Node_Fields_Should_NotBeInQueryIntrospection_When_MarkedInaccessible.yaml |
Captures hidden node fields. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Node_Fields_Should_BeInQueryIntrospection_When_NotMarkedInaccessible.yaml |
Captures default visible node fields. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Node_Field_Should_BeRejectedAsUnknownField_When_MarkedInaccessible.yaml |
Captures inaccessible-field rejection. |
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/__snapshots__/InaccessibleTests.Entities_Should_StillResolveAcrossSourceSchemas_When_NodeFieldIsMarkedInaccessible.yaml |
Captures cross-schema entity resolution. |
src/HotChocolate/Fusion/src/Fusion.Composition/SourceSchemaMerger.cs |
Preserves inaccessible metadata during composition. |
src/HotChocolate/Core/test/Types.Tests/Types/Composite/NodeFieldInaccessibleTests.cs |
Tests generated node-field directives. |
src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/NodeFieldInaccessibleTests.NodeFields_Should_NotBeInaccessible_When_OptionsAreDefault.graphql |
Captures default generated-field schema. |
src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/NodeFieldInaccessibleTests.NodeFields_Should_BeShareable_When_ShareableIsOffAndInaccessibleIsOn.graphql |
Captures shareable-field behavior. |
src/HotChocolate/Core/test/Types.Tests/Types/Composite/__snapshots__/NodeFieldInaccessibleTests.NodeFields_Should_BeInaccessibleAndShareable_When_OptionIsEnabled.graphql |
Captures enabled option behavior. |
src/HotChocolate/Core/test/Types.Tests/__snapshots__/SchemaOptionsTests.FromOptions_Should_CopyEveryOption_When_OptionsAreConfigured.snap |
Captures schema-option copying. |
src/HotChocolate/Core/src/Types/Types/Relay/NodeFieldTypeInterceptor.cs |
Applies inaccessible and shareable directives. |
src/HotChocolate/Core/src/Types/SchemaOptions.cs |
Adds and copies the mutable option. |
src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs |
Exposes the new public option. |
Review details
Suppressed comments (1)
src/HotChocolate/Core/src/Types/SchemaOptions.cs:263
- This new copy path is only covered by the snapshot's default
falsevalue:SchemaOptionsTestsnever setsApplyInaccessibleToNodeFields, so removing this assignment would still pass. Configure the option totruein the copy test (and update the snapshot), or add a focused assertion thatFromOptionspreserves it.
ApplyShareableToNodeFields = options.ApplyShareableToNodeFields,
ApplyInaccessibleToNodeFields = options.ApplyInaccessibleToNodeFields,
- Files reviewed: 16/16 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Patch coverage100.0% of changed lines covered (27/27)
Project coverage: 57.9% (288235/497843 lines) |
A composition with global object identification enabled synthesizes a canonical node field that belongs to the gateway, so @inaccessible on a source schema's node field no longer hides it. Under standard composition settings the node and nodes fields stay hidden.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
michaelstaib
added a commit
that referenced
this pull request
Sep 11, 2026
This was referenced Sep 15, 2026
This was referenced Sep 17, 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.
No description provided.