From 932c5b90a7b2e027edcfd9beae5031b64d89a8fd Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Sun, 20 Oct 2019 15:54:33 +0200 Subject: [PATCH] feat(errorHandler): added options arg --- src/smart-apollo.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/smart-apollo.js b/src/smart-apollo.js index 0816e8d..a0157e7 100644 --- a/src/smart-apollo.js +++ b/src/smart-apollo.js @@ -13,6 +13,7 @@ export default class SmartApollo { this._pollInterval = null this._watchers = [] this._destroyed = false + this.lastApolloOptions = null if (autostart) { this.autostart() @@ -134,6 +135,7 @@ export default class SmartApollo { generateApolloOptions (variables) { const apolloOptions = omit(this.options, this.vueApolloSpecialKeys) apolloOptions.variables = variables + this.lastApolloOptions = apolloOptions return apolloOptions } @@ -171,7 +173,7 @@ export default class SmartApollo { catchError (error) { addGqlError(error) - const catched = this.errorHandler(error, this.vm, this.key, this.type) + const catched = this.errorHandler(error, this.vm, this.key, this.type, this.lastApolloOptions) if (catched) return