Repository navigation
Fix missing pipeline state answering 400 or 422 instead of 500 - #10430
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
One moderate document-state classification issue and two test-name nits remain.
Review effort: Lite
Findings: None
What changed in this PR
Updates GraphQL pipeline error classification so internal state failures return HTTP 500 while client errors retain transport-specific statuses.
Changes:
- Adds internal-server status pins for invalid pipeline state.
- Handles empty variable batches with a dedicated request error.
- Adds transport-version HTTP integration coverage.
| File | Summary |
|---|---|
src/HotChocolate/Core/src/Types/Properties/Resources.resx |
Adds the empty variable-batch message. |
src/HotChocolate/Core/src/Types/Properties/Resources.Designer.cs |
Exposes the generated resource accessor. |
src/HotChocolate/Core/src/Types/Execution/Pipeline/OperationExecutionMiddleware.cs |
Detects empty variable batches. |
src/HotChocolate/Core/src/Types/Execution/ErrorHelper.cs |
Adds status pins and batch error handling. |
src/HotChocolate/Core/src/Execution.Pipeline/ErrorHelper.cs |
Separates request and internal document errors. |
src/HotChocolate/Core/src/Execution.Pipeline/DocumentValidationMiddleware.cs |
Classifies unresolved document requests. |
src/HotChocolate/AspNetCore/test/AspNetCore.Tests/GraphQLOverHttpSpecTests.cs |
Covers transport status behavior. |
Files not reviewed (1)
- src/HotChocolate/Core/src/Types/Properties/Resources.Designer.cs: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Patch coverage100.0% of changed lines covered (42/42)
Project coverage: 58.9% (300028/509797 lines) |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Files not reviewed (1)
- src/HotChocolate/Core/src/Types/Properties/Resources.Designer.cs: Generated file
This was referenced Sep 25, 2026
glen-84
added a commit
that referenced
this pull request
Oct 8, 2026
This was referenced Oct 10, 2026
Merged
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
StateInvalid*results had no status pin, so the formatter's fallback answered 400 underDraft20250508and 422 underDraft20260903. They now carry theInternalServerErrorpin thatRequestTimeoutand the cost-analysis state errors already use. The document validation middleware is shared with the Fusion gateway, so its guard answers the same way there.application/graphql-response+jsonunder every transport version and forapplication/jsonunderDraft20260903.application/jsonunderLegacyandDraft20250508stays 200.Test plan
GraphQLOverHttpSpecTestscover each guard over HTTP underDraft20250508andDraft20260903. A request middleware registered before the guarded middleware removes the state that middleware checks, so the real guard produces the result. At validation this covers a document parsed from the request, one loaded from persisted operation storage, and one taken from the document cache.HotChocolate.AspNetCore.Tests,HotChocolate.Execution.Tests,HotChocolate.CostAnalysis.Tests,HotChocolate.Fusion.AspNetCore.Tests, and the fourHotChocolate.PersistedOperations.*.Testsprojects pass on net10.0 with-p:EnforceCodeStyleInBuild=true.Follow-ups
context.VariableValues[0]in Fusion'sOperationExecutionMiddlewareand answers 500. This is read from the code, not probed.