Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix argument coercion for non-typed list elements - #9957

#9957
Merged
michaelstaib merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
mst/fix-9948ChilliCream/graphql-platform:mst/fix-9948Copy head branch name to clipboard
Jun 19, 2026
Merged

Fix argument coercion for non-typed list elements#9957
michaelstaib merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
mst/fix-9948ChilliCream/graphql-platform:mst/fix-9948Copy head branch name to clipboard

Conversation

@michaelstaib

@michaelstaib michaelstaib commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fixes #9948

Copilot AI review requested due to automatic review settings June 19, 2026 18:34

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.

Pull request overview

This PR addresses Hot Chocolate input argument coercion for lists whose element type is an input object that may be materialized as a Dictionary<string, object> (e.g., when input object fields are not runtime-bound). It ensures list elements are converted to the list’s runtime element type before being added to the strongly typed runtime list, preventing IList.Add type mismatch failures (Fixes #9948).

Changes:

  • Coerce (convert) parsed/deserialized list elements to the list element runtime type when the element GraphQL type is an input object.
  • Add tests covering both literal parsing and JSON input deserialization for lists of input objects without runtime field binding.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/HotChocolate/Core/src/Types/Types/InputParser.cs Converts input-object list elements to the runtime element type before adding to the runtime list (both literal and JSON paths).
src/HotChocolate/Core/test/Types.Tests/Types/InputParserTests.cs Adds regression tests for list-of-input-object coercion (literal + JSON).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/HotChocolate/Core/src/Types/Types/InputParser.cs
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in the mst/fix-9948 branch remains at 49%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 0dbeaa9 mst/fix-9948 aac9d9d +/-
/home/runner/wo...ageProcessor.cs 100% 89% -11%
/home/runner/wo...erMiddleware.cs 97% 89% -8%
/home/runner/wo...PromiseCache.cs 81% 78% -3%
/home/runner/wo...eiveEndpoint.cs 72% 69% -3%
/home/runner/wo...geDispatcher.cs 75% 73% -2%
/home/runner/wo...ueryExecutor.cs 67% 65% -2%
/home/runner/wo...tocolHandler.cs 85% 84% -1%
/home/runner/wo.../MemoryArena.cs 81% 82% +1%
/home/runner/wo...tionTestBase.cs 72% 80% +8%
/home/runner/wo...sageRecorder.cs 88% 100% +12%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@michaelstaib
michaelstaib merged commit 8880e08 into main Jun 19, 2026
141 of 142 checks passed
@michaelstaib
michaelstaib deleted the mst/fix-9948 branch June 19, 2026 21:21
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.

input arguments as array types

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.