Skip to content

[Fusion] Add support for source schema extensions#9621

Draft
glen-84 wants to merge 2 commits intomainfrom
gai/source-schema-extensions
Draft

[Fusion] Add support for source schema extensions#9621
glen-84 wants to merge 2 commits intomainfrom
gai/source-schema-extensions

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Apr 29, 2026

No description provided.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 15:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for “source schema extensions” by allowing a *-extensions.graphql* sidecar file to be discovered and appended to a source schema during Fusion composition (CLI and Aspire), with new test resources and coverage verifying the behavior.

Changes:

  • CLI: detect and ignore *-extensions.graphql* during directory schema discovery, and append sidecar extensions content when present.
  • Aspire: when reading schema from project directory, also append the *-extensions.graphql* sidecar file if it exists.
  • Tests/resources: add new SDL/settings/extension fixtures and new test cases validating composition output.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs Adds *-extensions sidecar detection, directory discovery filtering, and schema+extensions concatenation.
src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs Adds schema+extensions concatenation when reading schema from project directory.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionComposeCommandTests.cs Adds CLI tests for composing with extensions (file + directory discovery) and updates resource setup helper.
src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SchemaComposerTests.cs Adds a composition unit test ensuring extensions are applied during composition.
src/Nitro/CommandLine/test/CommandLine.Tests/resources/valid-extensions/* Adds new input schema/settings/extensions fixtures for CLI tests.
src/Nitro/CommandLine/test/CommandLine.Tests/resources/valid-extensions-result/composite-schema.graphqls Adds expected composed composite schema snapshot for extensions scenario.
Comments suppressed due to low confidence (1)

src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs:79

  • When --source-schema-file points directly to a *-extensions.graphql{s} sidecar, this branch treats it as the primary schema file and then looks for a non-existent *-extensions-settings.json, producing a confusing failure even if the base schema/settings exist. Consider detecting IsExtensionsFile(Path.GetFileName(schemaFilePath)) here and either (a) rejecting with a dedicated, actionable ExitException message, or (b) resolving the corresponding base schema/settings file by stripping the -extensions suffix.
        else if (fileSystem.FileExists(sourceSchemaPath))
        {
            schemaFilePath = sourceSchemaPath;
        }

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

Comment thread src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs Outdated
Comment thread src/HotChocolate/Fusion/src/Fusion.Aspire/SchemaComposition.cs
@glen-84 glen-84 marked this pull request as draft April 30, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants