Skip to content

Add inaccessible switch to global object identification options - #10381

Merged
michaelstaib merged 12 commits into
mainfrom
mst/node-inaccessible
Sep 11, 2026
Merged

michaelstaib merged 12 commits into
mainfrom
mst/node-inaccessible

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 11, 2026 09:02
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Sep 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 @inaccessible and @shareable directives.
  • 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 false value: SchemaOptionsTests never sets ApplyInaccessibleToNodeFields, so removing this assignment would still pass. Configure the option to true in the copy test (and update the snapshot), or add a focused assertion that FromOptions preserves 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.

Comment thread src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs
Comment thread src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs Outdated
Comment thread website/content/docs/fusion/entities-and-lookups.md Outdated
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (27/27)

File Covered Changed Patch %
src/HotChocolate/Core/src/Types/SchemaOptions.cs 2 2 100.0% 🟢
…/Core/src/Types/Types/Relay/NodeFieldTypeInterceptor.cs 25 25 100.0% 🟢

Project coverage: 57.9% (288235/497843 lines)

michaelstaib and others added 6 commits September 11, 2026 11:11
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants