Do not coerce field value for Optional<T> with default value#9131
Do not coerce field value for Optional<T> with default value#9131tobias-tengler merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where Optional fields with default values were incorrectly having their values set when not explicitly provided in the input. The fix ensures that Optional fields maintain their "unset" state (HasValue=false) when not provided, allowing consumers to distinguish between "field not provided" vs "field provided with default value".
Changes:
- Modified variable coercion logic to skip default value assignment for Optional fields
- Added comprehensive test coverage for the new behavior
- Fixed a typo in test class name (VariableBatchRequestTestss → VariableBatchRequestTests)
- Removed unused Empty property from OperationRequest and VariableBatchRequest classes
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| VariableCoercionHelper.cs | Updated field default value logic to exclude Optional fields (IsOptional: false check) |
| VariableCoercionHelperTests.cs | Added test verifying Optional fields with defaults remain unset when not provided |
| VariableBatchRequestTests.cs | Fixed typo in class name (removed extra 's') |
| VariableBatchRequest.cs | Removed unused Empty static property |
| OperationRequest.cs | Removed unused Empty static property |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
19c3a3e to
67d8d11
Compare
67d8d11 to
518ffa0
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 22134358990 • Commit b1f5e5b • Wed, 18 Feb 2026 10:26:51 GMT |
No description provided.