Repository navigation
Fix issue in the cost analyzer that deduplicated too aggressively - #9916
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the cost analysis “response name deduplication” behavior so that repeated response names (e.g., nodes, edges, pageInfo) are only deduplicated within a single selection set, ensuring nested connections and sibling selections are fully costed.
Changes:
- Reset per-selection-set response-name tracking in
CostAnalyzer.CalculateSelectionSetCostso nested selection sets can reuse response names without being skipped. - Add targeted tests covering flat connections, nested fan-out, limit enforcement, and sibling aliased connections.
- Update the existing static query analysis snapshot to reflect the corrected cost calculation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/HotChocolate/CostAnalysis/src/CostAnalysis/CostAnalyzer.cs |
Clears the shared Processed set per selection set and reorders the conditional so deduplication happens only after type/field applicability is confirmed. |
src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/NestedConnectionCostTests.cs |
Adds regression tests verifying nested and sibling connection costing and cost-limit rejection behavior. |
src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/__snapshots__/StaticQueryAnalysisTests.Execute_ConnectionQuery_ReturnsExpectedResult_0.md |
Updates expected operationCost values to match the corrected costing logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall coverage in the Show a code coverage summary of the most covered files.
Code Coverage is in Public Preview. Learn more and provide us with your feedback. |
This was referenced Jun 16, 2026
This was referenced Jun 24, 2026
This was referenced Jul 20, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 31, 2026
This was referenced Sep 8, 2026
This was referenced Sep 17, 2026
This was referenced Sep 28, 2026
This was referenced Oct 5, 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.
No description provided.