Skip to content

[Fusion] Add preprocessor.inferShareable source schema option#9816

Merged
tobias-tengler merged 2 commits into
mainfrom
tte/allow-to-disable-shareable-validation
Jun 2, 2026
Merged

[Fusion] Add preprocessor.inferShareable source schema option#9816
tobias-tengler merged 2 commits into
mainfrom
tte/allow-to-disable-shareable-validation

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 08:52
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Jun 2, 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.

Pull request overview

Adds a new --disable-shareable-validation CLI option (and matching Fusion archive setting) that skips @shareable validation by inferring @shareable on fields resolvable by multiple source schemas. Plumbing flows through CompositionSettings.PreprocessorSettingsSourceSchemaPreprocessorOptions.InferShareable, which now also triggers ApplyShareableDirectives outside Fusion v1 compatibility mode.

Changes:

  • New DisableShareableValidationOption wired into fusion compose and fusion settings set.
  • New SourceSchemaPreprocessorOptions.InferShareable flag gating ApplyShareableDirectives in the preprocessor.
  • Docs and CLI tests updated for the new option/setting.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/HotChocolate/Fusion/src/Fusion.Composition/SourceSchemaPreprocessor.cs Runs ApplyShareableDirectives when InferShareable is set.
src/HotChocolate/Fusion/src/Fusion.Composition/Options/SourceSchemaPreprocessorOptions.cs Adds InferShareable option.
src/HotChocolate/Fusion/src/Fusion.Composition/Settings/CompositionSettings.cs Adds DisableShareableValidation to preprocessor settings.
src/HotChocolate/Fusion/src/Fusion.Composition/Settings/SettingsExtensions.cs Merges the new setting and maps it to InferShareable.
src/Nitro/CommandLine/src/CommandLine/Options/DisableShareableValidationOption.cs New CLI option (contains a leftover TODO).
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs Threads the new option through compose and watch flows.
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs Handles the new setting name with boolean parsing.
src/Nitro/CommandLine/src/CommandLine/Arguments/FusionSettingsNameArgument.cs Registers disable-shareable-validation setting name.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionComposeCommandTests.cs Updates expected help output.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionSettingsSetCommandTests.cs Adds test for invalid bool value and updates expected listing.
website/src/docs/fusion/v16/cli.md Documents new CLI option and setting.
website/src/docs/fusion/v16/composition.md Mentions option as a way to bypass INVALID_FIELD_SHARING.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Nitro/CommandLine/src/CommandLine/Options/DisableShareableValidationOption.cs Outdated
@tobias-tengler tobias-tengler changed the title [Fusion] Add --disable-shareable-validation option [Fusion] Add preprocessor.inferShareable source schema option Jun 2, 2026
@tobias-tengler tobias-tengler merged commit 848d3e2 into main Jun 2, 2026
279 of 282 checks passed
@tobias-tengler tobias-tengler deleted the tte/allow-to-disable-shareable-validation branch June 2, 2026 11:04
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