Skip to content

Commit aafb8ae

Browse files
authored
useDeduplicateRequest is the Hive Gateway plugin name (#6761)
1 parent 0cf1194 commit aafb8ae

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
searchable: false
3-
---
4-
51
import { Callout } from '@theguild/components'
62

73
# Deduplicate HTTP Requests
@@ -14,16 +10,12 @@ To reduce the load on your downstream services, you can deduplicate the requests
1410
multiple requests for the same data are received at the same time, only one request will be sent to
1511
the downstream service, and the responses will be shared among the clients.
1612

17-
You can enable request deduplication by using the `useRequestDeduplication` plugin.
13+
You can enable request deduplication by using the built-in `useDeduplicateRequest` plugin like this:
1814

1915
```ts filename="gateway.config.ts"
20-
import { defineConfig, useRequestDeduplication } from '@graphql-hive/gateway'
16+
import { defineConfig, useDeduplicateRequest } from '@graphql-hive/gateway'
2117

2218
export const gatewayConfig = defineConfig({
23-
plugins: pluginCtx => [
24-
useRequestDeduplication({
25-
...pluginCtx
26-
})
27-
]
19+
plugins: ctx => [useDeduplicateRequest(ctx)]
2820
})
2921
```

0 commit comments

Comments
 (0)