Repository navigation
[Fusion] Compare the context type by name in ContextRequirementAlternatives - #11072
Open
michaelstaib wants to merge 1 commit into
Conversation
michaelstaib
force-pushed
the
neo/hc-17-gsn.55-context-alternative-name-check
branch
from
November 27, 2026 22:31
77ebd02 to
5a1bc25
Compare
michaelstaib
force-pushed
the
neo/hc-17-gsn.55-context-alternative-name-check
branch
from
November 30, 2026 21:02
5a1bc25 to
f63f960
Compare
michaelstaib
force-pushed
the
neo/hc-17-gsn.55-context-alternative-name-check
branch
from
November 30, 2026 21:16
f63f960 to
32fbe4e
Compare
michaelstaib
force-pushed
the
neo/hc-17-gsn.55-context-alternative-name-check
branch
from
November 30, 2026 21:46
32fbe4e to
89aeb34
Compare
michaelstaib
force-pushed
the
neo/hc-17-gsn.55-context-alternative-name-check
branch
from
December 1, 2026 00:52
89aeb34 to
7c1f148
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the context-requirement validation optimization.
No open issues 🎉
What changed in this PR
This PR optimizes Fusion’s context-requirement validation by comparing object type names directly instead of enumerating possible types, preserving the satisfiability check introduced in #11068.
Changes:
- Replace possible-type lookup with an ordinal type-name comparison to avoid allocations.
- Remove the unused schema parameter from the helper and its callers.
- Move
ContextRequirementArgumentinto its own file without changing its definition.
| File | Description |
|---|---|
| src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs | Update the helper call to omit the schema argument. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Satisfiability/ContextRequirementArgument.cs | House the existing argument record in a dedicated file. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Satisfiability/ContextRequirementAlternatives.cs | Compare type names directly and simplify helper signatures. |
Review effort: Balanced
This branch has not been deployed
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.
The check from #11068 now compares the type of the context value by name instead of walking the possible types, so it allocates nothing. The type condition of a context path is always an object type, so the result is the same. The record
ContextRequirementArgumentmoves to its own file.