Repository navigation
Read documentId from GraphQL GET requests - #10487
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
One or more issues must be addressed before approval.
Review effort: Lite
Findings: None
What changed in this PR
Adds documentId support for GraphQL GET persisted operations while preserving id precedence.
Changes:
- Extends GET parsing and middleware routing.
- Adds parser and end-to-end tests.
- Updates trusted-document and migration documentation.
| File | Description |
|---|---|
| website/content/docs/hotchocolate/performance/trusted-documents.md | Updated as part of this pull request. |
| website/content/docs/hotchocolate/migrating/migrate-from-16-6-to-16-7.md | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests/Serialization/DefaultHttpRequestParserTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetMiddlewareTests.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/Parsers/DefaultHttpRequestParser.cs | Updated as part of this pull request. |
| src/HotChocolate/AspNetCore/src/AspNetCore.Pipeline/HttpGetMiddleware.cs | Updated as part of this pull request. |
💡 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 (12/12)
Project coverage: 57.9% (301232/520007 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
documentIdquery parameter as well as fromid, the two names the POST body parser already accepts.documentIdis the name in the proposed persisted documents appendix to the GraphQL over HTTP specification (graphql/graphql-over-http#264), and urql's core sends it in the query string when a query prefers GET. A GET carrying onlydocumentIdwas not executed: it was served Nitro or got a404.id. The change coversMapGraphQL,MapGraphQLHttp, the Fusion gateway, and the Azure Functions integration, under every transport version.Test plan
documentIdis read whenidis absent,idwins when both are set, and an invaliddocumentIdis refused with the same error as an invalidid.GET /graphql?documentId=<id>executes the stored operation.HotChocolate.AspNetCore.Tests,HotChocolate.Fusion.AspNetCore.Tests, and both Azure Functions test projects pass on net10.0, andHotChocolate.AspNetCore.Pipelinebuilds on every target framework with code style enforced.