Repository navigation
Fix batching limits skipped for entries of request and operation batches - #10826
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change still has an active moderate issue because variable-batch policy rejections do not emit the specific diagnostic reason needed by listeners.
1 open issue
What changed in this PR
This pull request applies batching limits consistently to POST request batches and operation batches, including variable-set limits and disabled variable batching.
Changes:
- Passes
GraphQLServerOptionsinto operation-batch execution. - Enforces operation-count, variable-set-count, and variable-batching restrictions.
- Adds regression tests for oversized and disallowed batches.
| File | Summary |
|---|---|
src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpPostMiddlewareTests.cs |
Adds coverage for rejected oversized and disallowed request and operation batches. |
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpPostMiddlewareBase.cs |
Routes operation-batch execution through the options-aware overload. |
src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/ExecutorSession.cs |
Validates batch sizes and variable-batching configuration. The variable-batching rejection should emit the specific VariableBatchingDisabled diagnostic, and the new exception construction should use ThrowHelper. |
This pull request requires changes.
Review effort: Lite
Contributor
Patch coverage98.1% of changed lines covered (51/52)
Uncovered changed lines (JSON){
"sha": "54607821892bba8fac08b3d157507464491e8e46",
"files": [
{ "path": "src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/ExecutorSession.cs", "ranges": [[190, 190]] }
]
}Project coverage: 59.5% (321563/540867 lines) |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified, and the added validation paths are accompanied by regression coverage for batch limits, disabled variable batching, and diagnostics.
No open issues 🎉
1 resolved since last review
Review effort: Lite
This was referenced Nov 10, 2026
This was referenced Nov 19, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 32 others
AdCodicem/AdCodicem.ValueObjects#262
Closed
This was referenced Nov 26, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 43 others
AdCodicem/AdCodicem.ValueObjects#274
Closed
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.

Summary
BatchingandMaxBatchSizenow apply to each entry of a POST request batch and to each operation of an operation batch, the same as to a single request. An entry whose variable sets exceedMaxBatchSize, or that is a variable batch while variable batching is disabled, refuses the whole batch. As for a single request, a refusal because variable batching is disabled reports that reason to server diagnostics.batchOperationslist names more operations thanMaxBatchSizeis refused, as a request batch with too many entries already is.ExecutorSession.ExecuteOperationBatchAsynchas a new overload that takesGraphQLServerOptions, which the POST middleware now calls. The overload without options is obsolete.Test plan
HttpPostMiddlewareTestscases refuse a request batch entry and an operation batch whose variable sets exceedMaxBatchSizeor use variable batching while it is disabled, and an operation batch that names more operations thanMaxBatchSize. They fail onmain. Two of them check the reason reported to server diagnostics.HotChocolate.AspNetCore.TestsandHotChocolate.Fusion.AspNetCore.Tests.