apollo-link-ethereum
Advanced tools
Comparing version 0.0.32 to 0.0.33
@@ -299,2 +299,3 @@ (function (global, factory) { | ||
// Using some code taken from https://github.com/apollographql/apollo-link-state/blob/master/packages/apollo-link-state/src/index.ts | ||
var debug = require('debug')('apollo-link-ethereum:EthereumLink'); | ||
var EthereumLink = /** @class */ (function (_super) { | ||
@@ -330,6 +331,11 @@ __extends(EthereumLink, _super); | ||
var handlingNext = false; | ||
var observerErrorHandler = observer.error.bind(observer); | ||
var observerErrorHandler = function (error) { | ||
console.error('wtf? ', error); | ||
}; | ||
obs.subscribe({ | ||
next: function (args) { | ||
var data = args.data, errors = args.errors; | ||
if (errors) { | ||
console.error('many errors: ', errors); | ||
} | ||
var context = operation.getContext(); | ||
@@ -345,2 +351,12 @@ var _a = resolverFactory(_this.ethereumResolver, isSubscription), resolver = _a.resolver, resolverAfter = _a.resolverAfter, promises = _a.promises, subscriptions = _a.subscriptions; | ||
var errors = resolvePromises(nextData); | ||
debug("promiseFinally: ", nextData, " errors: ", errors); | ||
if (errors && errors.length) { | ||
errors = [ | ||
{ | ||
message: "Error resolving query:\n\n " + JSON.stringify(defn) + ":\n\n " + JSON.stringify(errors) + "\n\n", | ||
query: query, | ||
errors: errors | ||
} | ||
]; | ||
} | ||
observer.next({ | ||
@@ -359,2 +375,3 @@ data: nextData, | ||
next: function (_) { | ||
debug("subscription.subscribe: ", nextData); | ||
observer.next({ | ||
@@ -361,0 +378,0 @@ data: nextData |
@@ -21,2 +21,3 @@ var __extends = (this && this.__extends) || (function () { | ||
// Using some code taken from https://github.com/apollographql/apollo-link-state/blob/master/packages/apollo-link-state/src/index.ts | ||
var debug = require('debug')('apollo-link-ethereum:EthereumLink'); | ||
var EthereumLink = /** @class */ (function (_super) { | ||
@@ -52,6 +53,11 @@ __extends(EthereumLink, _super); | ||
var handlingNext = false; | ||
var observerErrorHandler = observer.error.bind(observer); | ||
var observerErrorHandler = function (error) { | ||
console.error('wtf? ', error); | ||
}; | ||
obs.subscribe({ | ||
next: function (args) { | ||
var data = args.data, errors = args.errors; | ||
if (errors) { | ||
console.error('many errors: ', errors); | ||
} | ||
var context = operation.getContext(); | ||
@@ -67,2 +73,12 @@ var _a = resolverFactory(_this.ethereumResolver, isSubscription), resolver = _a.resolver, resolverAfter = _a.resolverAfter, promises = _a.promises, subscriptions = _a.subscriptions; | ||
var errors = resolvePromises(nextData); | ||
debug("promiseFinally: ", nextData, " errors: ", errors); | ||
if (errors && errors.length) { | ||
errors = [ | ||
{ | ||
message: "Error resolving query:\n\n " + JSON.stringify(defn) + ":\n\n " + JSON.stringify(errors) + "\n\n", | ||
query: query, | ||
errors: errors | ||
} | ||
]; | ||
} | ||
observer.next({ | ||
@@ -81,2 +97,3 @@ data: nextData, | ||
next: function (_) { | ||
debug("subscription.subscribe: ", nextData); | ||
observer.next({ | ||
@@ -83,0 +100,0 @@ data: nextData |
{ | ||
"name": "apollo-link-ethereum", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"main": "./dist/bundle.umd.js", | ||
@@ -34,3 +34,3 @@ "modules": "./lib/index.js", | ||
}, | ||
"gitHead": "ee4316098afd49113ba2157c46825dc6a6ed14f6" | ||
"gitHead": "2136dca10a15165b772fb86c437297c12fd12d1e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
513445
1241