Skip to content

Commit 336a262

Browse files
committed
pro-1.22.0
1 parent 3cb7e27 commit 336a262

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

CHANGELOG-pro.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88

99
### Bug Fix
1010

11+
# 1.22.0 (19 March 2022)
12+
13+
### New Features
14+
15+
- Pusher subscriptions: it now sends updates in groups of 10 by default, pass `use ..., batch_size: 1` to revert to the previous behavior.
16+
- OperationStore: when using ActiveRecord for storage, it now batches updates to `last_used_at` every 5 seconds. Pass `use ..., update_last_used_at_every: 0` to update that column synchronously, instead, as before.
17+
1118
# 1.21.6 (16 March 2022)
1219

20+
### Bug Fix
21+
1322
- OperationStore: Fix no method error in Redis pipeline usage
1423

1524
# 1.21.5 (7 March 2022)

guides/operation_store/active_record_backend.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ GraphQL-Pro 1.15.0 introduced new features for the OperationStore. To enable the
8383
add_column :graphql_client_operations, :is_archived, :boolean, default: false
8484
add_column :graphql_client_operations, :last_used_at, :datetime
8585
```
86+
87+
## Updating `last_used_at`
88+
89+
By default, GraphQL-Pro updates `last_used_at` values in a background thread every 5 seconds. You can customize this by passing a number of seconds to `update_last_used_at_every:` when installing the OperationStore:
90+
91+
```ruby
92+
use GraphQL::Pro::OperationStore, update_last_used_at_every: 1 # seconds
93+
```
94+
95+
To update that column inline each time an operation is accessed, pass `0`.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f35ee054e97240c089f1f56d233875e6038ac264facfeddc0aeb2abd5d1c7c0844e92f2ab3087c45c2999f4fd7bec8720bcfd4794af19dc5e565afa884e1be85

guides/subscriptions/pusher_implementation.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ This will cause subscription payloads to include `compressed_result: "..."` inst
157157

158158
By configuring `compress_pusher_payload: true` on a query-by-query basis, the subscription backend can continue to support clients running _old_ client code (by not compressing) while upgrading new clients to compressed payloads.
159159

160+
### Batched Deliveries
161+
162+
By default, `PusherSubscriptions` sends updates in batches of up to 10 at a time, using [batch triggers](https://github.com/pusher/pusher-http-ruby#batches). You can customize the batch size by passing `batch_size:` when installing it, for example:
163+
164+
```ruby
165+
use GraphQL::Pro::PusherSubscriptions, batch_size: 1, ...
166+
```
167+
168+
`batch_size: 1` will make `PusherSubscriptions` use the single trigger API instead of batch triggers.
169+
160170
## Webhook configuration
161171

162172
Your server needs to receive webhooks from Pusher when clients disconnect. This keeps your local subscription database in sync with Pusher.

0 commit comments

Comments
 (0)