diff --git a/packages/vue-apollo-option/src/smart-apollo.js b/packages/vue-apollo-option/src/smart-apollo.js index daca81f..54cd543 100644 --- a/packages/vue-apollo-option/src/smart-apollo.js +++ b/packages/vue-apollo-option/src/smart-apollo.js @@ -98,6 +98,7 @@ export default class SmartApollo { const queryCb = this.initialOptions[prop].bind(this.vm) this.options[prop] = queryCb() let cb = query => { + if (this._destroyed) return this.options[prop] = query this.refresh() } diff --git a/packages/vue-apollo-option/src/smart-query.js b/packages/vue-apollo-option/src/smart-query.js index 2242dda..bda4b5d 100644 --- a/packages/vue-apollo-option/src/smart-query.js +++ b/packages/vue-apollo-option/src/smart-query.js @@ -94,6 +94,8 @@ export default class SmartQuery extends SmartApollo { } executeApollo (variables) { + if (this._destroyed) return + const variablesJson = JSON.stringify(variables) if (this.sub) { diff --git a/packages/vue-apollo-option/src/smart-subscription.js b/packages/vue-apollo-option/src/smart-subscription.js index 474feed..eb7e98b 100644 --- a/packages/vue-apollo-option/src/smart-subscription.js +++ b/packages/vue-apollo-option/src/smart-subscription.js @@ -28,6 +28,8 @@ export default class SmartSubscription extends SmartApollo { } executeApollo (variables) { + if (this._destroyed) return + const variablesJson = JSON.stringify(variables) if (this.sub) { // do nothing if subscription is already running using exactly the same variables