Skip to content

Fix mutation error mapping for multiple exception constructors#9211

Merged
michaelstaib merged 1 commit intomainfrom
mst/issue-5991
Feb 25, 2026
Merged

Fix mutation error mapping for multiple exception constructors#9211
michaelstaib merged 1 commit intomainfrom
mst/issue-5991

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

Overview

  • fix constructor-based payload error factory compilation for error types with multiple exception constructors
  • correct the expression-chain fallback path to reuse the previous conditional expression directly
  • add regression tests covering both constructor paths (InvalidOperationException and NullReferenceException)

Verification

  • dotnet test src/HotChocolate/Core/test/Types.Mutations.Tests/HotChocolate.Types.Mutations.Tests.csproj --filter "FullyQualifiedName~ErrorMiddleware_Should_MapMultipleConstructors"
  • dotnet test src/HotChocolate/Core/test/Types.Mutations.Tests/HotChocolate.Types.Mutations.Tests.csproj --filter "FullyQualifiedName~ErrorMiddlewareTests" --framework net10.0

Fixes #5991

@michaelstaib michaelstaib merged commit 39b4fc3 into main Feb 25, 2026
118 checks passed
@michaelstaib michaelstaib deleted the mst/issue-5991 branch February 25, 2026 12:22
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 6921.55 0.00%
Ramping (0-500-0 VUs) 7379.40 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.56ms 5.97ms 7.08ms 11.13ms 15.75ms 177.56ms
Ramping 0.56ms 24.29ms 29.82ms 64.16ms 77.05ms 183.78ms
query TestQuery {
  topProducts(first: 5) {
    inStock
    name
    price
    shippingEstimate
    upc
    weight
    reviews {
      id
      body
      author {
        id
        username
        name
      }
    }
  }
}

Deep Recursion Query

Req/s Err%
Constant (50 VUs) 1298.70 0.00%
Ramping (0-500-0 VUs) 1349.51 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 4.06ms 33.97ms 37.39ms 51.13ms 60.41ms 344.28ms
Ramping 1.80ms 131.84ms 157.60ms 342.64ms 387.89ms 818.43ms
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

Req/s Err%
Constant (50 VUs) 23696.38 0.00%
Ramping (0-500-0 VUs) 18302.93 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.08ms 1.72ms 2.06ms 3.97ms 4.82ms 40.85ms
Ramping 0.08ms 9.52ms 11.52ms 23.78ms 28.43ms 104.18ms
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 22396202037 • Commit 5327570 • Wed, 25 Feb 2026 16:52: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.

Mutation error mapping with constructor throws with more than one exception type

1 participant