Skip to content

Read documentId from GraphQL GET requests - #10487

Merged
glen-84 merged 1 commit into
mainfrom
gai/read-document-id-over-get
Oct 6, 2026
Merged

glen-84 merged 1 commit into
mainfrom
gai/read-document-id-over-get

Conversation

@glen-84

@glen-84 glen-84 commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

  • A GraphQL GET request reads the persisted operation's document ID from a documentId query parameter as well as from id, the two names the POST body parser already accepts. documentId is 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 only documentId was not executed: it was served Nitro or got a 404.
  • A GET request that carries both uses id. The change covers MapGraphQL, MapGraphQLHttp, the Fusion gateway, and the Azure Functions integration, under every transport version.
  • The trusted documents page and the 16.6 to 16.7 migration guide document it.

Test plan

  • Parser tests: documentId is read when id is absent, id wins when both are set, and an invalid documentId is refused with the same error as an invalid id.
  • End-to-end test: 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, and HotChocolate.AspNetCore.Pipeline builds on every target framework with code style enforced.

Copilot AI lite review requested due to automatic review settings October 6, 2026 08:28
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (12/12)

File Covered Changed Patch %
…/AspNetCore/src/AspNetCore.Pipeline/HttpGetMiddleware.cs 2 2 100.0% 🟢
…/src/AspNetCore.Pipeline/Parsers/DefaultHttpRequestParser.cs 10 10 100.0% 🟢

Project coverage: 57.9% (301232/520007 lines)

@glen-84
glen-84 merged commit 74e36fe into main Oct 6, 2026
159 checks passed
@glen-84
glen-84 deleted the gai/read-document-id-over-get branch October 6, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants