[Fusion] Fixed satisfiability issue with fields on the Query type#9076
[Fusion] Fixed satisfiability issue with fields on the Query type#9076
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the satisfiability validator that caused validation to fail when fields on the Query type (root type) had @require directives. The issue occurred because the code attempted to peek at the path stack when it was empty for root-level fields.
Changes:
- Fixed null handling when validating requirements on root Query type fields
- Made the
parentPathItemparameter nullable throughout the validation chain - Added test coverage for the root requirement scenario
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| SatisfiabilityValidator.cs | Changed to pass previousPathItem (which is null-safe) instead of calling context.Path.Peek() when validating requirements |
| RequirementsValidator.cs | Updated Validate method signature to accept nullable parentPathItem and modified constructor to conditionally push parent path item only when non-null |
| SatisfiabilityValidatorTests.cs | Added RootRequirement test case that verifies a Query field with @require directive referencing another Query field validates successfully |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 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 21479822483 • Commit 4233a58 • Thu, 29 Jan 2026 13:41:29 GMT |
Summary of the changes (Less than 80 chars)