Skip to content

[Fusion] Fix issue with RemoveUnreferencedDefinitions and custom scalars#9188

Merged
glen-84 merged 1 commit intomainfrom
gai/fix-remove-unreferenced-definitions
Feb 24, 2026
Merged

[Fusion] Fix issue with RemoveUnreferencedDefinitions and custom scalars#9188
glen-84 merged 1 commit intomainfrom
gai/fix-remove-unreferenced-definitions

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Feb 24, 2026

Summary of the changes (Less than 80 chars)

  • [Fusion] Fix issue with RemoveUnreferencedDefinitions and custom scalars.

Copilot AI review requested due to automatic review settings February 24, 2026 15:28
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 custom scalars were being incorrectly removed during schema composition when they were used in @require directives or as dependencies of input objects used in such directives.

Changes:

  • Fixed RemoveUnreferencedDefinitions to preserve custom scalars (not just input objects) used in @require and @lookup directives
  • Leveraged existing graph traversal to handle transitive dependencies (e.g., custom scalars used by preserved input objects)
  • Added comprehensive tests for both direct and transitive custom scalar preservation

Reviewed changes

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

File Description
SourceSchemaMergerTests.cs Added two new tests: one for direct custom scalar preservation in @require, another for transitive preservation via input objects
SourceSchemaMerger.cs Removed GetPreservedInputTypeNames method and updated to pass _schemas to RemoveUnreferencedDefinitions
MutableSchemaDefinitionExtensions.cs Refactored RemoveUnreferencedDefinitions to accept source schemas, replaced GetPreservedInputTypeNames with GetPreservedTypeNames that preserves all non-spec-scalar types, simplified removal logic

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

@glen-84 glen-84 merged commit 147298a into main Feb 24, 2026
121 checks passed
@glen-84 glen-84 deleted the gai/fix-remove-unreferenced-definitions branch February 24, 2026 15:36
@github-actions
Copy link
Copy Markdown
Contributor

Fusion Gateway Performance Results

Simple Composite Query

Req/s Err%
Constant (50 VUs) 6954.02 0.00%
Ramping (0-500-0 VUs) 7331.12 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.56ms 5.99ms 7.05ms 10.76ms 15.55ms 177.94ms
Ramping 0.59ms 24.16ms 30.06ms 64.09ms 76.44ms 194.77ms
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) 1282.68 0.00%
Ramping (0-500-0 VUs) 1338.10 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 4.25ms 34.12ms 37.83ms 51.76ms 60.95ms 412.09ms
Ramping 1.85ms 133.61ms 158.58ms 343.14ms 391.21ms 697.58ms
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) 23708.41 0.00%
Ramping (0-500-0 VUs) 18453.68 0.00%
Response Times & Query
Min Med Avg P90 P95 Max
Constant 0.08ms 1.71ms 2.06ms 3.98ms 4.81ms 47.97ms
Ramping 0.08ms 9.49ms 11.43ms 23.46ms 28.16ms 105.89ms
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 22357623769 • Commit a8c8d3e • Tue, 24 Feb 2026 15:47:07 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