Skip to content

Fix IsSelectedPatternValidation to reference field from pattern type and add test#9127

Merged
tobias-tengler merged 2 commits intomainfrom
pse/fix-is-selected
Feb 18, 2026
Merged

Fix IsSelectedPatternValidation to reference field from pattern type and add test#9127
tobias-tengler merged 2 commits intomainfrom
pse/fix-is-selected

Conversation

@PascalSenn
Copy link
Copy Markdown
Member

@PascalSenn PascalSenn commented Feb 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 01:53
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

Fixes schema validation for IsSelected pattern attributes used on non-root (non-Query) object types, preventing failures during schema build and adding a regression test to lock in behavior.

Changes:

  • Update IsSelectedPatternValidation to resolve the target field from the declaring pattern type instead of schema.QueryType.
  • Add a new resolver test exercising IsSelected pattern usage on a nested object type field.
  • Add a snapshot for the new test result.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/HotChocolate/Core/src/Types/Configuration/Validation/IsSelectedPatternValidation.cs Uses pattern.Type.Fields[...] so patterns on nested object types validate against the correct declaring type.
src/HotChocolate/Core/test/Types.Tests/Resolvers/IsSelectedTests.cs Adds regression test that previously would trigger a KeyNotFoundException when the pattern was declared on a non-Query type.
src/HotChocolate/Core/test/Types.Tests/Resolvers/snapshots/IsSelectedTests.IsSelected_Pattern_On_NonQueryType_Should_Build_Schema.md Snapshot for the new regression test output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
2954.76 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.82ms 14.81ms 171.96ms 16.70ms 30.70ms 36.09ms

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

Requests/sec Error Rate
3277.04 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.75ms 65.55ms 242.49ms 67.93ms 127.45ms 143.97ms

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
741.86 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
8.89ms 62.91ms 340.85ms 65.88ms 80.64ms 88.94ms

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

Requests/sec Error Rate
814.18 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
1.85ms 249.39ms 734.70ms 263.16ms 531.23ms 574.52ms

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
23968.21 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.10ms 1.68ms 49.75ms 2.04ms 3.88ms 4.75ms

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

Requests/sec Error Rate
18886.81 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.10ms 9.18ms 112.38ms 11.17ms 22.95ms 27.76ms

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 22123342451 • Commit 3f06c12 • Wed, 18 Feb 2026 02:12:02 GMT

@tobias-tengler tobias-tengler merged commit d2452d4 into main Feb 18, 2026
117 checks passed
@tobias-tengler tobias-tengler deleted the pse/fix-is-selected branch February 18, 2026 12:19
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 2947.01 0.00%
Ramping (0-500-0 VUs) 3164.01 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.78ms 14.86ms 16.74ms 30.84ms 36.54ms 173.12ms
Ramping 0.77ms 67.14ms 70.48ms 133.74ms 152.62ms 275.57ms
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) 750.11 0.00%
Ramping (0-500-0 VUs) 819.10 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 8.80ms 62.14ms 65.14ms 81.23ms 89.48ms 363.67ms
Ramping 1.84ms 252.39ms 262.65ms 530.04ms 569.09ms 717.31ms
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) 23182.17 0.00%
Ramping (0-500-0 VUs) 18482.20 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.10ms 1.74ms 2.11ms 4.02ms 4.90ms 46.22ms
Ramping 0.10ms 9.45ms 11.46ms 23.46ms 28.37ms 105.66ms
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 22139280746 • Commit 27ef8bd • Wed, 18 Feb 2026 13:17:17 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.

4 participants