Repository navigation
Answer unsupported methods and media types in Azure Functions - #10488
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Add Azure Functions integration coverage for enabled QUERY requests and unsupported content types.
Review effort: Lite
Findings: None
What changed in this PR
Updates Azure Functions to support Draft20260903 responses for unsupported methods and media types while preserving legacy behavior.
Changes:
- Adds unsupported-request middleware.
- Updates the Azure Functions template and documentation.
- Adds in-process and isolated-process integration tests.
| File | Summary |
|---|---|
website/content/docs/hotchocolate/server/http-transport.md |
Documents Azure Functions routing behavior. |
website/content/docs/hotchocolate/migrating/migrate-from-16-6-to-16-7.md |
Updates migration guidance. |
templates/azure-function/GraphQLFunction.cs |
Allows all methods to reach Hot Chocolate. |
src/HotChocolate/AzureFunctions/test/HotChocolate.AzureFunctions.Tests/InProcessEndToEndTests.cs |
Tests in-process transport responses. |
src/HotChocolate/AzureFunctions/test/HotChocolate.AzureFunctions.IsolatedProcess.Tests/IsolatedProcessEndToEndTests.cs |
Tests isolated-process transport responses. |
src/HotChocolate/AzureFunctions/src/HotChocolate.AzureFunctions/Extensions/HotChocolateAzureFunctionServiceCollectionExtensions.cs |
Adds unsupported-request handling. |
💡 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 (4/4)
Project coverage: 57.9% (301334/520261 lines) |
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
Draft20260903transport version, the Azure Functions pipeline answers a request no GraphQL middleware takes the wayMapGraphQLdoes:405with anAllowheader for an unsupported method,204withAllowforOPTIONS, and415for aPOSTorQUERYwith an unsupportedContent-Type. It ends with the sameHttpUnsupportedRequestMiddleware, scoped to the function route, so a request below the route still gets404.LegacyandDraft20250508answers do not change, andDraft20260903is new in 16.7.graphql-azftemplate'sHttpTriggerlists no methods, so every method reaches Hot Chocolate. The Functions host answers a method the trigger does not list with404itself (Azure/azure-functions-host#11625, Azure/azure-functions-dotnet-worker#2452), which the HTTP transport page now states.405that a GET gets when GET requests are disabled underDraft20260903.Test plan
InProcessEndToEndTestsandIsolatedProcessEndToEndTestspin aPUT, anOPTIONS, atext/plainPOST, atext/plainQUERYwith QUERY requests enabled, and a GET with GET requests disabled underLegacy,Draft20250508, andDraft20260903, plus aPUTbelow the function route. TheDraft20260903rows fail without the middleware.QUERYrequest with QUERY requests enabled, which fails without the QUERY middleware in the Azure Functions pipeline.net8.0,net9.0,net10.0, andnet11.0.