Layer 1: Subgraph Request Deduplication
Deduplicates identical fetches to the same subgraph across concurrent operations. The deduplication key is:- DataSourceID: identifies the target subgraph
- requestBody: the complete JSON payload (query + variables)
- preComputedHeaderHash: xxhash64 of all headers that will be forwarded to this subgraph, as determined by your header forwarding rules
Query operations are eligible. Mutations and subscriptions are never deduplicated.
Layer 2: Inbound Request Deduplication
Deduplicates identical client requests before the engine even starts resolving. The key is:How Header Hashes Are Computed
The header hashes for both layers are computed bySubgraphHeadersBuilder, which:
- Iterates over every subgraph involved in the execution plan
- Applies all configured header forwarding rules (global + per-subgraph) against the current inbound request headers
- Produces a deterministic
uint64hash per subgraph - Combines all per-subgraph hashes into a single
allHash
RouterOnRequestHandler and RouterMiddlewareHandler hooks run, but before EnginePreOriginHandler.OnOriginRequest hooks run.
Request Pipeline and Hook Ordering
Configuration Reference
ENGINE_ENABLE_SINGLE_FLIGHTENGINE_FORCE_ENABLE_SINGLE_FLIGHTENGINE_ENABLE_INBOUND_REQUEST_DEDUPLICATIONENGINE_FORCE_ENABLE_INBOUND_REQUEST_DEDUPLICATION