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

Add EnforceNullVariableValuesForMultipartFileUpload option - #9842

#9842
Merged
tobias-tengler merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
tte/allow-non-null-upload-variable-valueChilliCream/graphql-platform:tte/allow-non-null-upload-variable-valueCopy head branch name to clipboard
Jun 4, 2026
Merged

Add EnforceNullVariableValuesForMultipartFileUpload option#9842
tobias-tengler merged 2 commits into
mainChilliCream/graphql-platform:mainfrom
tte/allow-non-null-upload-variable-valueChilliCream/graphql-platform:tte/allow-non-null-upload-variable-valueCopy head branch name to clipboard

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 4, 2026 07:51

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 introduces a new GraphQLServerOptions.EnforceNullVariableValuesForMultipartFileUpload option to control whether multipart upload variable locations must contain null placeholders (strict spec behavior) or whether non-null placeholders are tolerated and replaced (lenient behavior).

Changes:

  • Add EnforceNullVariableValuesForMultipartFileUpload to server options (default true) and wire it into multipart variable rewriting.
  • Introduce a new multipart error (message + ThrowHelper) for non-null placeholders when strict enforcement is enabled.
  • Add/extend tests in both AspNetCore and Fusion to cover strict vs lenient placeholder handling.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/HotChocolate/Primitives/src/Primitives/ErrorCodes.cs Adds a new server error code for non-null multipart placeholders (currently collides with an existing code).
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FileUploadTests.cs Adds Fusion gateway tests for strict vs lenient multipart placeholder behavior.
src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpMultipartMiddlewareTests.cs Adds an AspNetCore middleware test asserting strict rejection for non-null placeholders.
src/HotChocolate/AspNetCore/test/AspNetCore.Tests/snapshots/HttpMultipartMiddlewareTests.Upload_File_In_InputObject_With_NonNull_Placeholder_Should_Be_Rejected.snap Snapshot for the new strict-rejection middleware test.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Utilities/ThrowHelper.cs Adds a dedicated ThrowHelper exception for the new strict enforcement error.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.resx Adds the localized error message for non-null placeholder enforcement.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.Designer.cs Adds the generated resource accessor for the new message.
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Options/GraphQLServerOptions.cs Adds the new enforcement option and includes it in Clone().
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpMultipartMiddleware.cs Implements strict/lenient placeholder handling during variables rewrite.
Files not reviewed (1)
  • src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.Designer.cs: Language not supported

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

Comment thread src/HotChocolate/Primitives/src/Primitives/ErrorCodes.cs Outdated
Comment thread src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FileUploadTests.cs Outdated
Comment thread src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FileUploadTests.cs Outdated
@tobias-tengler
tobias-tengler merged commit 21ef4ca into main Jun 4, 2026
143 of 145 checks passed
@tobias-tengler
tobias-tengler deleted the tte/allow-non-null-upload-variable-value branch June 4, 2026 08:33
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

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