Skip to content

[Analyzer] Update BindMemberAnalyzer to also consider properties of base classes#9160

Merged
tobias-tengler merged 1 commit intomainfrom
tte/fix-bindmember-analyzer
Feb 19, 2026
Merged

[Analyzer] Update BindMemberAnalyzer to also consider properties of base classes#9160
tobias-tengler merged 1 commit intomainfrom
tte/fix-bindmember-analyzer

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 19, 2026 16:45
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 PR updates the BindMemberAnalyzer to correctly handle members inherited from base classes. Previously, the analyzer would incorrectly report an error when using [BindMember] to reference a property that exists in a base class but not directly on the derived class.

Changes:

  • Added HasMember helper method that walks the base type hierarchy to check for member existence
  • Updated ValidateMemberExists to use the new helper instead of only checking the immediate type
  • Added two new test cases to verify the fix works with both nameof() and string literal syntax

Reviewed changes

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

File Description
src/HotChocolate/Core/src/Types.Analyzers/BindMemberAnalyzer.cs Refactored member existence check to walk base class hierarchy using new HasMember helper method
src/HotChocolate/Core/test/Types.Analyzers.Tests/BindMemberAnalyzerTests.cs Added two test cases for inherited members: one using nameof() and one using string literal
src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/BindMemberAnalyzerTests.BindMember_WithNameof_InheritedMember_NoError.md Snapshot file showing expected generated code for nameof() test
src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/BindMemberAnalyzerTests.BindMember_WithString_InheritedMember_NoError.md Snapshot file showing expected generated code for string literal test

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

@tobias-tengler tobias-tengler merged commit 346baaa into main Feb 19, 2026
123 checks passed
@tobias-tengler tobias-tengler deleted the tte/fix-bindmember-analyzer branch February 19, 2026 16:52
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 2941.45 0.00%
Ramping (0-500-0 VUs) 3208.07 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.81ms 14.87ms 16.78ms 31.10ms 36.63ms 171.58ms
Ramping 0.75ms 65.79ms 69.48ms 132.97ms 150.60ms 270.70ms
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) 753.75 0.00%
Ramping (0-500-0 VUs) 832.21 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 9.10ms 61.98ms 64.80ms 79.84ms 88.22ms 342.27ms
Ramping 1.84ms 246.46ms 259.23ms 524.20ms 558.51ms 669.64ms
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) 23249.83 0.00%
Ramping (0-500-0 VUs) 18463.81 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.10ms 1.73ms 2.10ms 3.99ms 4.90ms 52.89ms
Ramping 0.10ms 9.42ms 11.43ms 23.45ms 28.12ms 105.93ms
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 22191073326 • Commit bcd5b12 • Thu, 19 Feb 2026 17:14:00 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