-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow providing a buffer for pubsub subscribe call
- Loading branch information
Showing
2 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'@graphql-yoga/subscription': minor | ||
--- | ||
|
||
Support providing a `RepeaterBuffer` to the `PubSub.subscribe` method, by using the new object based call signature. | ||
|
||
```ts | ||
import { createPubSub } from 'graphql-yoga' | ||
import { SlidingBuffer } from '@repeaterjs/repeater' | ||
|
||
const pubSub = createPubSub() | ||
|
||
pubSub.subscribe({ | ||
topic: "userChanged", | ||
id: "1", | ||
buffer: new SlidingBuffer(1_000) | ||
}) | ||
``` | ||
|
||
Learn more about buffers on the [Repeater.js website](https://repeater.js.org/docs/safety#3-buffering-and-dropping-values). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters