Skip to content

Document router-level in-flight request deduplication#62

Merged
kamilkisiela merged 7 commits into
mainfrom
copilot/document-request-deduplication-and-traffic-shaping
Apr 2, 2026
Merged

Document router-level in-flight request deduplication#62
kamilkisiela merged 7 commits into
mainfrom
copilot/document-request-deduplication-and-traffic-shaping

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

  • Rename router-level/subgraph-level deduplication to Inbound/Outbound
  • Fix oxfmt formatting issue in traffic_shaping.mdx (CI format:check failure)

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

…edupe)

Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/48a7439a-30d4-4a63-9ea7-1a1bb9baf7e2
Copilot AI changed the title [WIP] Document request deduplication and traffic shaping configurations Document router-level in-flight request deduplication Mar 24, 2026
Copilot AI requested a review from kamilkisiela March 24, 2026 09:59
GraphQL operations arrive simultaneously, the router sends only one request to subgraphs and shares
the response with all waiting clients.
The router supports two complementary levels of in-flight request deduplication that can be enabled
independently: **router-level** (new in recent versions) and **subgraph-level**.
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.

Suggested change
independently: **router-level** (new in recent versions) and **subgraph-level**.
independently: **router-level** and **subgraph-level**.

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 change it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 1524010.

Comment on lines +124 to +149
```yaml
traffic_shaping:
router:
dedupe:
enabled: true
headers: all # default — include every header
```

```yaml
traffic_shaping:
router:
dedupe:
enabled: true
headers: none # ignore all headers (requests from any user may be deduplicated)
```

```yaml
traffic_shaping:
router:
dedupe:
enabled: true
headers:
include: # include only these headers in the fingerprint
- authorization
- cookie
```
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 use Tabs component

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already added in e84480a — those three code blocks are now inside a Tabs component with tabs labeled "all (default)", "none", and "include".

Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/94054bfc-ee33-4d78-bce2-e8fa5674a497
Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/b092cd0a-de49-4d90-8b0d-d90d222721be
Comment thread packages/documentation/content/docs/router/configuration/traffic_shaping.mdx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 24, 2026

Co-authored-by: kamilkisiela <8167190+kamilkisiela@users.noreply.github.com>
Agent-Logs-Url: https://github.com/graphql-hive/docs/sessions/35bff6bb-7f05-4563-a948-b881a07f71e0
kamilkisiela added a commit to graphql-hive/router that referenced this pull request Mar 24, 2026
- Add inbound router request deduplication for concurrent identical
GraphQL requests, with atomic in-flight key claiming and leader/joiner
response sharing.
- Feature behind `traffic_shaping.router.dedupe.enabled` (default: false
- but I'm open to change it. I made it 'all' and disabled by default as
anything that makes a request "unique" affects the request fingerprint
and therefore deduplication), and include current schema checksum in the
dedupe fingerprint to prevent cross-schema sharing.
- Restrict response sharing to `query` operations only

```yaml
traffic_shaping:
  router:
    dedupe:
      enabled: true # default
      headers: all # default
```

---

The deduplication key is built out of:
- request method and path
- selected request headers (based on dedupe header policy - see examples
below)
- normalized operation hash
- GraphQL variables hash
- GraphQL extensions hash
- schema checksum

Header policy: include all headers in the req fingerprint
```yaml
headers: all
```

Header policy: do not include headers in the req fingerprint
```yaml
headers: none
```

Header policy: include only some headers in the req fingerprint
```yaml
headers:
  include:
    - authorization
    - cookie
```

Docs: graphql-hive/docs#62
Copilot AI pushed a commit to graphql-hive/router that referenced this pull request Mar 24, 2026
- Add inbound router request deduplication for concurrent identical
GraphQL requests, with atomic in-flight key claiming and leader/joiner
response sharing.
- Feature behind `traffic_shaping.router.dedupe.enabled` (default: false
- but I'm open to change it. I made it 'all' and disabled by default as
anything that makes a request "unique" affects the request fingerprint
and therefore deduplication), and include current schema checksum in the
dedupe fingerprint to prevent cross-schema sharing.
- Restrict response sharing to `query` operations only

```yaml
traffic_shaping:
  router:
    dedupe:
      enabled: true # default
      headers: all # default
```

---

The deduplication key is built out of:
- request method and path
- selected request headers (based on dedupe header policy - see examples
below)
- normalized operation hash
- GraphQL variables hash
- GraphQL extensions hash
- schema checksum

Header policy: include all headers in the req fingerprint
```yaml
headers: all
```

Header policy: do not include headers in the req fingerprint
```yaml
headers: none
```

Header policy: include only some headers in the req fingerprint
```yaml
headers:
  include:
    - authorization
    - cookie
```

Docs: graphql-hive/docs#62
@kamilkisiela kamilkisiela merged commit 874887c into main Apr 2, 2026
8 checks passed
@kamilkisiela kamilkisiela deleted the copilot/document-request-deduplication-and-traffic-shaping branch April 2, 2026 16:55
dotansimha pushed a commit to graphql-hive/router that referenced this pull request Apr 13, 2026
- Add inbound router request deduplication for concurrent identical
GraphQL requests, with atomic in-flight key claiming and leader/joiner
response sharing.
- Feature behind `traffic_shaping.router.dedupe.enabled` (default: false
- but I'm open to change it. I made it 'all' and disabled by default as
anything that makes a request "unique" affects the request fingerprint
and therefore deduplication), and include current schema checksum in the
dedupe fingerprint to prevent cross-schema sharing.
- Restrict response sharing to `query` operations only

```yaml
traffic_shaping:
  router:
    dedupe:
      enabled: true # default
      headers: all # default
```

---

The deduplication key is built out of:
- request method and path
- selected request headers (based on dedupe header policy - see examples
below)
- normalized operation hash
- GraphQL variables hash
- GraphQL extensions hash
- schema checksum

Header policy: include all headers in the req fingerprint
```yaml
headers: all
```

Header policy: do not include headers in the req fingerprint
```yaml
headers: none
```

Header policy: include only some headers in the req fingerprint
```yaml
headers:
  include:
    - authorization
    - cookie
```

Docs: graphql-hive/docs#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waits for release Represents changes in a library that have not yet been released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants