[Fusion] Only visit input objects once while building the execution tree#9189
[Fusion] Only visit input objects once while building the execution tree#9189tobias-tengler merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an infinite loop issue in the operation planner when processing recursive input object types. The fix adds cycle detection using a visited set to ensure each input object type is only processed once while traversing the type graph to check for Upload scalars.
Changes:
- Added cycle detection in
DoVariablesContainUploadScalarmethod using a HashSet with ReferenceEqualityComparer - Added integration test for recursive input object types
- Added snapshot for the recursive input object type test
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Planning/OperationPlanner.BuildExecutionTree.cs | Adds visited HashSet to prevent infinite loop when traversing recursive input object types |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntegrationTests.cs | Adds new integration test for recursive input object type handling |
| src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/snapshots/IntegrationTests.Recursive_Input_Object_Type.yaml | Adds snapshot for the recursive input object type test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9189 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fusion Gateway Performance ResultsSimple Composite Query
Response Times & Query
query TestQuery {
topProducts(first: 5) {
inStock
name
price
shippingEstimate
upc
weight
reviews {
id
body
author {
id
username
name
}
}
}
}Deep Recursion Query
Response Times & Query
query TestQuery {
users {
id
username
name
reviews {
id
body
product {
inStock
name
price
shippingEstimate
upc
weight
reviews {
id
body
author {
id
username
name
reviews {
id
body
product {
inStock
name
price
shippingEstimate
upc
weight
}
}
}
}
}
}
}
topProducts(first: 5) {
inStock
name
price
shippingEstimate
upc
weight
reviews {
id
body
author {
id
username
name
reviews {
id
body
product {
inStock
name
price
shippingEstimate
upc
weight
}
}
}
}
}
}Variable Batching Throughput
Response Times & Query
query TestQuery($upc: ID!, $price: Long!, $weight: Long!) {
productByUpc(upc: $upc) {
inStock
shippingEstimate(weight: $weight, price: $price)
}
}Variables (5 sets batched per request) [
{ "upc": "1", "price": 899, "weight": 100 },
{ "upc": "2", "price": 1299, "weight": 1000 },
{ "upc": "3", "price": 15, "weight": 20 },
{ "upc": "4", "price": 499, "weight": 100 },
{ "upc": "5", "price": 1299, "weight": 1000 }
]Run 22359942335 • Commit db26327 • Tue, 24 Feb 2026 16:44:12 GMT |
No description provided.