Skip to content

Commit 5954bdd

Browse files
committed
js-1.6.1
1 parent 1178fb1 commit 5954bdd

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

guides/javascript_client/relay_subscriptions.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,30 @@ const network = Network.create(fetchQuery, subscriptionHandler)
102102

103103
Since `OperationStoreClient` is in the `fetchOperation` function, it will apply to all GraphQL operations.
104104

105+
## Ably
106+
107+
Pass `ably:` to get Subscription updates over Ably:
108+
109+
```js
110+
// Require the helper function
111+
var createHandler = require("graphql-ruby-client/subscriptions/createHandler")
112+
113+
// Load Ably and create a client
114+
const Ably = require("ably")
115+
const ablyClient = new Ably.Realtime("your-app-key")
116+
117+
// Create a Relay Modern-compatible handler
118+
var subscriptionHandler = createHandler({
119+
pusher: ablyClient,
120+
fetchOperation: null // TODO!
121+
})
122+
123+
// Create a Relay Modern network with the handler
124+
var network = Network.create(fetchQuery, subscriptionHandler)
125+
```
126+
127+
For `fetchOperation`, see [`fetchOperation` function](#fetchoperation-function) above.
128+
105129
## ActionCable
106130

107131
With this configuration, `subscription` queries will be routed to ActionCable.

javascript_client/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# graphql-ruby-client
22

3+
## 1.6.1 (30 Nov 2018)
4+
5+
- Support `ably:` option for Relay subscriptions
6+
37
## 1.6.0 (19 Nov 2018)
48

59
- Fix unused requires #1943

javascript_client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-ruby-client",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "JavaScript client for graphql-ruby",
55
"main": "index.js",
66
"repository": "https://github.com/rmosolgo/graphql-ruby-client",

0 commit comments

Comments
 (0)