Skip to content

Commit 0661461

Browse files
committed
Fix unnecessary refresh
1 parent 6177036 commit 0661461

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-apollo",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "Vue apollo integration",
55
"main": "index.js",
66
"scripts": {

src/smart-apollo.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ class SmartApollo {
1212

1313
// Query callback
1414
if (typeof this.options.query === 'function') {
15-
const queryCb = this.options.query
16-
this.vm.$watch(queryCb.bind(this.vm), query => {
15+
const queryCb = this.options.query.bind(this.vm)
16+
this.options.query = queryCb()
17+
this.vm.$watch(queryCb, query => {
1718
this.options.query = query
1819
this.refresh()
19-
}, {
20-
immediate: true,
2120
})
2221
}
2322

0 commit comments

Comments
 (0)