Skip to content

[Fusion] Compare the context type by name in ContextRequirementAlternatives - #11072

Open
michaelstaib wants to merge 1 commit into
neo/hc-17-gsn.52-no-context-alternative-e2efrom
neo/hc-17-gsn.55-context-alternative-name-check
Open

michaelstaib wants to merge 1 commit into
neo/hc-17-gsn.52-no-context-alternative-e2efrom
neo/hc-17-gsn.55-context-alternative-name-check

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

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 ContextRequirementArgument moves to its own file.

@michaelstaib
michaelstaib force-pushed the neo/hc-17-gsn.55-context-alternative-name-check branch from 77ebd02 to 5a1bc25 Compare November 27, 2026 22:31
@michaelstaib
michaelstaib force-pushed the neo/hc-17-gsn.55-context-alternative-name-check branch from 5a1bc25 to f63f960 Compare November 30, 2026 21:02
@michaelstaib
michaelstaib force-pushed the neo/hc-17-gsn.55-context-alternative-name-check branch from f63f960 to 32fbe4e Compare November 30, 2026 21:16
@michaelstaib
michaelstaib force-pushed the neo/hc-17-gsn.55-context-alternative-name-check branch from 32fbe4e to 89aeb34 Compare November 30, 2026 21:46
@michaelstaib
michaelstaib force-pushed the neo/hc-17-gsn.55-context-alternative-name-check branch from 89aeb34 to 7c1f148 Compare December 1, 2026 00:52
Copilot AI balanced review requested due to automatic review settings December 1, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 ContextRequirementArgument into 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

No deployments
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