Skip to content

Do not coerce field value for Optional<T> with default value#9131

Merged
tobias-tengler merged 1 commit intomainfrom
tte/fix-optional-coercion
Feb 18, 2026
Merged

Do not coerce field value for Optional<T> with default value#9131
tobias-tengler merged 1 commit intomainfrom
tte/fix-optional-coercion

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 09:34
@tobias-tengler tobias-tengler changed the title Do not set field value for Optional<T> with default value Do not initialize field value for Optional<T> with default value Feb 18, 2026
@tobias-tengler tobias-tengler changed the title Do not initialize field value for Optional<T> with default value Do not coerce field value for Optional<T> with default value Feb 18, 2026
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 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.

@tobias-tengler tobias-tengler force-pushed the tte/fix-optional-coercion branch from 19c3a3e to 67d8d11 Compare February 18, 2026 09:37
@tobias-tengler tobias-tengler force-pushed the tte/fix-optional-coercion branch from 67d8d11 to 518ffa0 Compare February 18, 2026 09:38
@tobias-tengler tobias-tengler merged commit 28736bc into main Feb 18, 2026
117 checks passed
@tobias-tengler tobias-tengler deleted the tte/fix-optional-coercion branch February 18, 2026 09:43
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
2919.99 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.78ms 14.91ms 172.89ms 16.90ms 31.38ms 36.89ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
3342.95 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.86ms 65.94ms 244.07ms 66.61ms 124.25ms 139.37ms

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 Query

Constant Load (50 VUs)

Requests/sec Error Rate
747.90 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
8.35ms 62.64ms 375.52ms 65.35ms 80.99ms 88.94ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
821.31 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
1.84ms 253.97ms 690.11ms 260.99ms 520.88ms 559.90ms

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 Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
23166.50 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.10ms 1.74ms 45.60ms 2.11ms 4.03ms 4.90ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
18244.39 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.10ms 9.61ms 106.54ms 11.61ms 23.89ms 28.95ms

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

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