graphql-ruby-client
Advanced tools
Comparing version 1.7.6 to 1.7.7
# graphql-ruby-client | ||
## 1.7.7 (15 Apr 2020) | ||
- Ably handler: dispatch initial response #2866 | ||
- Ably handler: catch any error in initial HTTP call #2877 | ||
## 1.7.6 (3 Apr 2020) | ||
@@ -4,0 +9,0 @@ |
@@ -10,3 +10,16 @@ "use strict"; | ||
// POST the subscription like a normal query | ||
fetchOperation(operation, variables, cacheConfig).then(function (response) { | ||
fetchOperation(operation, variables, cacheConfig) | ||
.then(function (response) { | ||
var dispatchResult = function (result) { | ||
if (result) { | ||
if (result.errors) { | ||
// What kind of error stuff belongs here? | ||
observer.onError(result.errors); | ||
} | ||
else if (result.data) { | ||
observer.onNext({ data: result.data }); | ||
} | ||
} | ||
}; | ||
dispatchResult(response.body); | ||
channelName = response.headers.get("X-Subscription-ID"); | ||
@@ -26,10 +39,3 @@ channel = ably.channels.get(channelName); | ||
var payload = message.data; | ||
var result = payload.result; | ||
if (result && result.errors) { | ||
// What kind of error stuff belongs here? | ||
observer.onError(result.errors); | ||
} | ||
else if (result) { | ||
observer.onNext({ data: result.data }); | ||
} | ||
dispatchResult(payload.result); | ||
if (!payload.more) { | ||
@@ -40,3 +46,4 @@ // Subscription is finished | ||
}); | ||
}); | ||
}) | ||
.catch(function (error) { return observer.onError(error); }); | ||
return { | ||
@@ -43,0 +50,0 @@ dispose: function () { |
{ | ||
"name": "graphql-ruby-client", | ||
"version": "1.7.6", | ||
"version": "1.7.7", | ||
"description": "JavaScript client for graphql-ruby", | ||
@@ -33,3 +33,6 @@ "main": "dist/index.js", | ||
"typescript": "^3.7.5" | ||
}, | ||
"prettier": { | ||
"semi": false | ||
} | ||
} |
489626
94
2595