From c8ab8dbfb32d87c3e26151b1b55e02520a8bc2dc Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 12 Feb 2018 16:42:38 +0100 Subject: [PATCH] SmartSubscription: bind updateQuery to vm - fix #154 --- src/smart-subscription.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/smart-subscription.js b/src/smart-subscription.js index aa4045e..9139791 100644 --- a/src/smart-subscription.js +++ b/src/smart-subscription.js @@ -24,6 +24,10 @@ export default class SmartSubscription extends SmartApollo { const apolloOptions = this.generateApolloOptions(variables) + if (typeof apolloOptions.updateQuery === 'function') { + apolloOptions.updateQuery = apolloOptions.updateQuery.bind(this.vm) + } + if (this.options.linkedQuery) { this.sub = this.options.linkedQuery.subscribeToMore(apolloOptions) } else {