Skip to content

Add inbound in-flight request deduplication to gateway runtime#2118

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/implement-inbound-request-deduplication
Draft

Add inbound in-flight request deduplication to gateway runtime#2118
Copilot wants to merge 4 commits intomainfrom
copilot/implement-inbound-request-deduplication

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

This introduces router-runtime style inbound request deduplication for concurrent identical GraphQL requests. The runtime now coalesces matching in-flight query operations so joiners reuse the leader execution result instead of re-executing.

  • Config surface

    • Added inboundRequestDeduplication to runtime config:
      • true | false
      • { enabled?: boolean; headers?: 'all' | 'none' | { include: string[] } }
    • Keeps feature opt-in and allows controlling header participation in fingerprinting.
  • Inbound dedupe implementation

    • Added useInboundRequestDeduplication plugin and wired it into createGatewayRuntime.
    • Deduplication happens at onParams level with atomic in-flight key claiming.
    • Scope is intentionally limited to GraphQL query operations (mutations are excluded).
    • Fingerprint includes:
      • schema version (increments on schema change, preventing cross-schema sharing)
      • method + pathname
      • selected headers (policy-based)
      • operation name + query + variables + extensions
  • Schema-change safety

    • In-flight store is cleared on onSchemaChange.
    • Keys include schema version, so dedupe does not bridge different schema snapshots.
  • Focused coverage

    • Added runtime tests for:
      • deduping parallel identical queries
      • not deduping mutations
createGatewayRuntime({
  proxy: { endpoint: 'http://localhost:4000/graphql' },
  inboundRequestDeduplication: {
    enabled: true,
    headers: { include: ['authorization', 'cookie'] },
  },
});

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • rover.apollo.dev
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node ./install.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 2 commits March 17, 2026 21:48
…equests

Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Copilot AI changed the title [WIP] Add inbound request deduplication for router runtime Add inbound in-flight request deduplication to gateway runtime Mar 17, 2026
Copilot AI requested a review from kamilkisiela March 17, 2026 21:52
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.

3 participants