Repository navigation
Add opt-in support for the HTTP QUERY method - #10420
Merged
Merged
Conversation
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
What changed in this PR
Adds opt-in HTTP QUERY support across ASP.NET Core, Azure Functions, clients, diagnostics, Fusion, tests, and documentation.
Changes:
- Adds
EnableQueryRequestsand QUERY middleware with batching and status handling. - Adds client
QueryAsyncAPIs and QUERY diagnostics. - Enforces operation-kind and incremental-delivery rules in Fusion.
| File | Description |
|---|---|
| website/content/docs/hotchocolate/server/options.md | Updated as part of this pull request. |
| website/content/docs/hotchocolate/server/http-transport.md | Updated as part of this pull request. |
| website/content/docs/hotchocolate/server/endpoints.md | Updated as part of this pull request. |
| website/content/docs/fusion/migration/migrate-from-16-6-to-16-7.md | Updated as part of this pull request. |
| src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/OperationKindTests.cs | Updated as part of this pull request. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.resx | Updated as part of this pull request. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.Designer.cs | Updated as part of this pull request. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Pipeline/OperationExecutionMiddleware.cs | Updated as part of this pull request. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/ErrorHelper.cs | Updated as part of this pull request. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityServerDiagnosticListenerTests.cs | Updated as part of this pull request. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Query_SingleRequest_GetHeroName.snap | Updated as part of this pull request. |
| src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Query_SingleRequest_GetHeroName_NET11_0.snap | Updated as part of this pull request. |
| src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/Http/ExecuteHttpRequestSpan.cs | Updated as part of this pull request. |
| src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/Extensions/HotChocolateAzureFunctionServiceCollectionExtensions.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/Transport.Http.Tests/GraphQLHttpClientTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests/PersistedOperationMiddlewareTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpQueryMiddlewareTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests/GraphQLOverHttpSpecTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests.Utilities/TestOperationDocumentStorage.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/Transport.Http/HttpResources.resx | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/Transport.Http/HttpResources.Designer.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpMethod.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpClientExtensions.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Utilities/MiddlewareHelper.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Utilities/ErrorHelper.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.resx | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.Designer.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/PersistedOperationMiddleware.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Options/GraphQLServerOptions.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/MiddlewareFactory.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Instrumentation/HttpRequestKind.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpUnsupportedRequestMiddleware.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpQueryMiddleware.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpHeaderValues.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpHeaderKeys.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Extensions/HttpMethodsExtensions.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Extensions/EndpointRouteBuilderExtensions.cs | Updated as part of this pull request. |
Files not reviewed (3)
- src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Properties/AspNetCorePipelineResources.Designer.cs: Generated file
- src/HotChocolate/AspNetCore/src/Transport.Http/HttpResources.Designer.cs: Generated file
- src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.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 coverage88.8% of changed lines covered (372/419) Uncovered changed lines (JSON){
"sha": "dbb3a287dad5eb3fa0be71d01feb8ef27d4ae038",
"files": [
{ "path": "src/HotChocolate/AspNetCore/src/Transport.Http/GraphQLHttpClientExtensions.cs", "ranges": [[852, 858], [988, 994], [1028, 1034]] },
{ "path": "src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/PersistedOperationMiddleware.cs", "ranges": [[147, 152], [173, 178], [182, 187]] },
{ "path": "src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Utilities/MiddlewareHelper.cs", "ranges": [[210, 214]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Pipeline/OperationExecutionMiddleware.cs", "ranges": [[149, 150]] },
{ "path": "src/HotChocolate/AspNetCore/src/Transport.Http/DefaultGraphQLHttpClient.cs", "ranges": [[395, 395]] }
]
}Project coverage: 58.4% (294726/504457 lines) |
This was referenced Oct 25, 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
292268c4; that PR is not merged yet.GraphQLServerOptions.EnableQueryRequests(defaultfalse) enablesHttpQueryMiddleware, which executes a single query operation from a POST-shaped JSON body. A mutation or subscription is refused with 422 (200 forapplication/jsonunderDraft20250508andLegacy, per those revisions' rule), request, operation, and variable batches are refused with 400, and@deferand@streamwork as they do over GET. UnderDraft20260903the endpoint lists QUERY inAllow, answers a QUERY request with an unsupportedContent-Typewith 415, and carriesAccept-Query: application/jsonon its 405, 204, and 415 responses. The persisted-operation endpoint maps QUERY when the option is on.HotChocolate.Transport.HttpgainsGraphQLHttpMethod.Queryand nineQueryAsyncoverloads mirroringGetAsync. The diagnostics span of a QUERY request isGraphQL HTTP QUERY. Three docs pages describe the option, the request shape, and the status codes.Acceptheader, as the Core executor already does. On a gateway, a mutation over GET answers 405 instead of executing, a mutation or subscription over QUERY answers 422, and a subscription or an operation with@deferor@streamwhoseAcceptheader grants no streaming media type answers 406 before execution. The Fusion 16.7 migration guide documents this change.Follow-ups
Allowfor unmapped methods on the persisted-operation path, which answer 404 under every transport version today.Content-Typevalidation on the persisted-operation path, which parses any request media type for POST and QUERY today.@deferwith no undeferred sibling answers 500 on a gateway.Test plan
HttpQueryMiddlewareTests, the QUERY theories inGraphQLOverHttpSpecTestsacrossLegacy,Draft20250508, andDraft20260903, QUERY routes inPersistedOperationMiddlewareTests,QueryAsyncinGraphQLHttpClientTests, theHttp_Query_SingleRequest_GetHeroNameactivity snapshots on net10 and net11, andOperationKindTestsagainst a gateway.EnforceCodeStyleInBuild.HttpMethods.QueryandHttpMethods.IsQuerycome from a static extension block on net8 and net9, where ASP.NET Core does not define them.