We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1268980 commit d168c20Copy full SHA for d168c20
packages/vue-apollo/src/smart-apollo.js
@@ -112,10 +112,19 @@ export default class SmartApollo {
112
cb = this.options.throttle ? throttle(cb, this.options.throttle) : cb
113
cb = this.options.debounce ? debounce(cb, this.options.debounce) : cb
114
}
115
- this._watchers.push(this.vm.$watch(() => this.options.variables.call(this.vm), cb, {
116
- immediate: true,
117
- deep: this.options.deep,
118
- }))
+
+ this._watchers.push(
+ this.vm.$watch(
+ () => typeof this.options.variables === 'function'
119
+ ? this.options.variables.call(this.vm)
120
+ : this.options.variables,
121
+ cb,
122
+ {
123
+ immediate: true,
124
+ deep: this.options.deep,
125
+ }
126
+ )
127
128
} else {
129
this.executeApollo(this.options.variables)
130
0 commit comments