Repository navigation
Fix composition crash on bare enum default for list-typed argument - #10244
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Fusion composition post-merge validation crashing on spec-lawful bare enum (and object) defaults supplied for list-typed arguments/fields by applying GraphQL list input coercion and hardening type handling to avoid invalid casts.
Changes:
- Add list input coercion handling in
EnumTypeDefaultValueInaccessibleRule.ValidateDefaultValueso non-list default values on list types validate against the element type. - Replace unsafe casts with type checks to prevent
InvalidCastExceptionand ignore undeclared input object fields during traversal. - Add regression tests covering bare enum defaults on list types (both accessible and inaccessible cases) plus object-default edge cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/HotChocolate/Fusion/src/Fusion.Composition/PostMergeValidationRules/EnumTypeDefaultValueInaccessibleRule.cs | Implements list input coercion and safe type checks to prevent crashes and correctly validate inaccessible enum references. |
| src/HotChocolate/Fusion/test/Fusion.Composition.Tests/PostMergeValidationRules/EnumTypeDefaultValueInaccessibleRuleTests.cs | Adds regression coverage for bare enum/object defaults on list-typed inputs and verifies expected diagnostics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Patch coverage71.4% of changed lines covered (15/21)
Uncovered changed lines (JSON){
"sha": "1461fbe0916f1c3b3d3ed0edb4fc93dda42c62c0",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Composition/PostMergeValidationRules/EnumTypeDefaultValueInaccessibleRule.cs", "ranges": [[87, 88], [103, 104], [119, 120]] }
]
}Project coverage: 54.5% (243366/446649 lines) |
This was referenced Aug 29, 2026
Merged
This was referenced Sep 21, 2026
Closed
Closed
Closed
This was referenced Sep 28, 2026
This was referenced Oct 5, 2026
Merged
This was referenced Oct 19, 2026
This was referenced Oct 26, 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.
Fixes #10222