[Fusion] Fix issue with RemoveUnreferencedDefinitions and custom scalars#9188
Merged
[Fusion] Fix issue with RemoveUnreferencedDefinitions and custom scalars#9188
Conversation
Contributor
There was a problem hiding this comment.
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
RemoveUnreferencedDefinitionsto preserve custom scalars (not just input objects) used in@requireand@lookupdirectives - 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.
Contributor
Fusion Gateway Performance ResultsSimple Composite Query
Response Times & Query
query TestQuery {
topProducts(first: 5) {
inStock
name
price
shippingEstimate
upc
weight
reviews {
id
body
author {
id
username
name
}
}
}
}Deep Recursion Query
Response Times & Query
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
Response Times & Query
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 |
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes (Less than 80 chars)