[Fusion] Align composition between Aspire and CommandLine#9084
[Fusion] Align composition between Aspire and CommandLine#9084tobias-tengler merged 2 commits intomainfrom
Conversation
46b8079 to
5662f9b
Compare
There was a problem hiding this comment.
Pull request overview
This pull request centralizes GraphQL schema composition logic by moving it from the Nitro CLI into the HotChocolate.Fusion.Composition library, making it reusable across different contexts (CLI and Aspire). The refactoring improves code organization and reduces duplication.
Changes:
- Moved composition logic from
FusionComposeCommandto a new sharedCompositionHelperclass inHotChocolate.Fusion.Composition - Relocated settings classes from
ChilliCream.Nitro.CommandLine.Settingsnamespace toHotChocolate.Fusionnamespace - Refactored Aspire integration to use the centralized composition helper with proper resource disposal
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.resx | Removed unused resource string for disabled global object identification |
| src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.Designer.cs | Auto-generated changes from resource file update |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs | Updated import to use HotChocolate.Fusion namespace |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs | Removed unused import and updated to use CompositionHelper |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs | Removed unused import |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs | Removed composition logic (moved to CompositionHelper), updated imports, and removed unused helper methods |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs | Updated directive name references (with minor style inconsistency) |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs | Updated directive name references (with minor style inconsistency) |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SourceSchemaSettings.cs | Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SettingsJsonSerializerContext.cs | Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/SettingsExtensions.cs | Changed namespace and removed unused import |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Settings/CompositionSettings.cs | Changed namespace from ChilliCream.Nitro.CommandLine.Settings to HotChocolate.Fusion |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/HotChocolate.Fusion.Composition.csproj | Added InternalsVisibleTo for nitro and Aspire, added Fusion.Packaging project reference |
| src/HotChocolate/Fusion-vnext/src/Fusion.Composition/CompositionHelper.cs | New file containing centralized composition logic |
| src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/SourceSchemaInfo.cs | Changed SchemaSettings type from JsonElement to JsonDocument for proper resource management |
| src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/SchemaComposition.cs | Added JsonDocument disposal, updated to use AspireCompositionHelper |
| src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/GraphQLCompositionSettings.cs | Changed EnableGlobalObjectIdentification from bool to bool? |
| src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/CompositionHelper.cs | Deleted - functionality moved to shared CompositionHelper |
| src/HotChocolate/Fusion-vnext/src/Fusion.Aspire/AspireCompositionHelper.cs | New file containing Aspire-specific composition wrapper |
Files not reviewed (1)
- src/Nitro/CommandLine/src/CommandLine/Properties/CommandLineResources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sourceMetadata.IsLookup = outputField.Directives.ContainsName(Lookup); | ||
| sourceMetadata.HasExternalDirective = outputField.Directives.ContainsName(External); | ||
| sourceMetadata.HasInternalDirective = outputField.Directives.ContainsName(Internal); | ||
| sourceMetadata.HasInternalDirective = outputField.Directives.ContainsName(WellKnownDirectiveNames.Internal); |
There was a problem hiding this comment.
The use of WellKnownDirectiveNames.Internal is inconsistent with the rest of the file. Line 11 imports using static HotChocolate.Fusion.WellKnownDirectiveNames;, which brings all constants into scope. Other directives in this file (such as Lookup on line 85, External on line 86, Override on line 88, etc.) are referenced without the WellKnownDirectiveNames. prefix. For consistency, Internal should be used directly instead of WellKnownDirectiveNames.Internal.
b4d792b to
1e952c6
Compare
🚀 Fusion Gateway Performance ResultsSimple Composite QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
}
}
}
}Deep Recursion QueryConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
users {
...User
reviews {
...Review
product {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}
}
topProducts(first: 5) {
...Product
reviews {
...Review
author {
...User
reviews {
...Review
product {
...Product
}
}
}
}
}
}Variable Batching ThroughputConstant Load (50 VUs)
📊 Response Time Metrics
Ramping Load (0→50→500→50 VUs)
📊 Response Time Metrics
Executed Query query TestQuery_8f7a46ce_2(
$__fusion_1_upc: ID!
$__fusion_2_price: Long!
$__fusion_2_weight: Long!
) {
productByUpc(upc: $__fusion_1_upc) {
inStock
shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
}
}Variables (5 sets batched in single request) [
{ "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
{ "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
{ "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
{ "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]No baseline data available for comparison. Run 21715908458 • Commit 4a7ef6e • Thu, 05 Feb 2026 15:03:16 GMT |

No description provided.