Repository navigation
[Fusion] Resolve abstract types from raw UTF-8 type names for small implementer sets - #10084
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes abstract type resolution during value completion by avoiding string allocations when resolving __typename for small possible-type sets, using raw UTF-8 comparisons.
Changes:
- Added
SourceResultElement.TryGetRawStringValue(...)to expose raw UTF-8 bytes for non-escaped JSON strings. - Cached UTF-8 encoded type names on
FusionObjectTypeDefinition(Utf8Name) for allocation-free comparisons. - Updated
ValueCompletion.GetType(...)to resolve abstract types via raw UTF-8__typenamematching for up to 8 candidates, with a fallback to the existing string-based lookup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultElement.cs | Adds an API to retrieve raw UTF-8 bytes for simple JSON string values. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs | Uses raw UTF-8 __typename to resolve abstract types for small implementer sets; narrows schema usage to fusion schema. |
| src/HotChocolate/Fusion/src/Fusion.Execution.Types/FusionObjectTypeDefinition.cs | Stores a pre-encoded UTF-8 name to enable allocation-free type-name matching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs
Contributor
Patch coverage94.0% of changed lines covered (94/100)
Uncovered changed lines (JSON){
"sha": "38e2c436121fa9c6484549603740375bd78c7b8d",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.Text.cs", "ranges": [[53, 57]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs", "ranges": [[1128, 1128]] }
]
}Project coverage: 53.4% (227570/426362 lines) |
This was referenced Jul 13, 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 Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
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.