diff --git a/package.json b/package.json index 96a3d1e..f4deeb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-apollo", - "version": "1.2.1", + "version": "1.2.2", "description": "Vue apollo integration", "main": "index.js", "scripts": { diff --git a/src/smart-apollo.js b/src/smart-apollo.js index 9930ed3..b243436 100644 --- a/src/smart-apollo.js +++ b/src/smart-apollo.js @@ -12,12 +12,11 @@ class SmartApollo { // Query callback if (typeof this.options.query === 'function') { - const queryCb = this.options.query - this.vm.$watch(queryCb.bind(this.vm), query => { + const queryCb = this.options.query.bind(this.vm) + this.options.query = queryCb() + this.vm.$watch(queryCb, query => { this.options.query = query this.refresh() - }, { - immediate: true, }) }