[Fusion] Add preprocessor.inferShareable source schema option#9816
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.PreprocessorSettings → SourceSchemaPreprocessorOptions.InferShareable, which now also triggers ApplyShareableDirectives outside Fusion v1 compatibility mode.
Changes:
- New
DisableShareableValidationOptionwired intofusion composeandfusion settings set. - New
SourceSchemaPreprocessorOptions.InferShareableflag gatingApplyShareableDirectivesin 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.
This was referenced Jun 3, 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.