Skip to content

docs(gateway): extend Request Deduplication page with inbound gateway-level deduplication#77

Merged
ardatan merged 5 commits intomainfrom
copilot/extend-request-deduplication-docs
Apr 6, 2026
Merged

docs(gateway): extend Request Deduplication page with inbound gateway-level deduplication#77
ardatan merged 5 commits intomainfrom
copilot/extend-request-deduplication-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

The deduplication page previously only covered outbound (transport-level) deduplication. This adds documentation for the new inbound gateway-level deduplication introduced in graphql-hive/gateway#2179, modelled after the Router's equivalent docs.

Changes

  • Restored the original introductory paragraph explaining why deduplication matters
  • Restructured the page into two explicit sections: Outbound (enabled by default) and Inbound (disabled by default)
  • Added inbound deduplication docs covering:
    • Basic enable flag
    • Default deduplication key composition (method, URL, headers, operation doc, name, variables)
    • Header filtering via shouldIncludeHeader
    • Full key customisation via getDeduplicationKeys
    • Per-request conditional toggling via enabled
    • Limitations: queries only; @defer/@stream excluded
import { defineConfig } from "@graphql-hive/gateway";

export const gatewayConfig = defineConfig({
  inboundInflightRequestDeduplication: {
    // Only factor in the authorization header when building the dedup key
    shouldIncludeHeader: (headerName) => headerName === "authorization",
  },
});

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Hive Gateway “Deduplicate Inflight Requests” documentation to cover the newly introduced inbound (gateway-level) inflight request deduplication, alongside the existing outbound (transport-level) deduplication, clarifying when each applies and how to configure them.

Changes:

  • Reintroduces/expands the introduction and reframes the page around two deduplication layers (outbound vs inbound).
  • Documents inbound deduplication configuration (enable flag, key composition, header filtering, key customization, per-request enabling).
  • Adds a limitations section for inbound deduplication (queries only; excludes @defer/@stream).
Comments suppressed due to low confidence (1)

packages/documentation/content/docs/gateway/other-features/performance/deduplicate-inflight-requests.mdx:30

  • The example imports HTTPTransportOptions from @graphql-tools/executor-http as a value import. Elsewhere in these docs (e.g. the gateway v1→v2 migration guide) HTTPTransportOptions is shown as a type import, and it’s imported from @graphql-hive/gateway. To keep examples consistent and avoid potential runtime import issues in TS transpilers that preserve value imports, consider switching this to a type-only import and aligning the import source with the migration guide.
import { defineConfig } from "@graphql-hive/gateway";
import { HTTPTransportOptions } from "@graphql-tools/executor-http";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ardatan
Copy link
Copy Markdown
Member

ardatan commented Apr 4, 2026

@copilot apply changes based on the comments in this thread

…nd add data-leakage warnings

Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/d2742b15-dd3d-49ac-bc64-0cbf75aa2aa4

Co-authored-by: ardatan <20847995+ardatan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

@copilot apply changes based on the comments in this thread

Applied all three changes from that review thread in commit 3b94821:

  1. "in-flight" → "inflight" – consistent with the rest of the Gateway docs.
  2. Directionality fix – outbound section now reads "identical requests to the same downstream subgraph service" instead of "same upstream resource".
  3. Data-leakage warnings – added before both the shouldIncludeHeader and getDeduplicationKeys sections, calling out the risk of cross-user response sharing when narrowing/replacing the deduplication key.

@ardatan ardatan merged commit bce17c7 into main Apr 6, 2026
8 checks passed
@ardatan ardatan deleted the copilot/extend-request-deduplication-docs branch April 6, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants