Skip to content

Commit 5a25b15

Browse files
committed
Fix loading count bugs, variables change not using cache
1 parent 905ff10 commit 5a25b15

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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.3",
3+
"version": "1.2.5",
44
"description": "Vue apollo integration",
55
"main": "index.js",
66
"scripts": {

src/smart-apollo.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ export class SmartQuery extends SmartApollo {
166166
})
167167
} else if (this.observer) {
168168
// Update variables
169-
this.observer.setVariables(variables)
169+
// Don't use setVariables directly or it will ignore cache
170+
this.observer.setOptions(this.generateApolloOptions(variables))
170171
} else {
171172
if (this.sub) {
172173
this.sub.unsubscribe()
@@ -184,7 +185,9 @@ export class SmartQuery extends SmartApollo {
184185

185186
const currentResult = this.observer.currentResult()
186187
if (currentResult.loading) {
187-
this.applyLoadingModifier(1)
188+
if (!this.loading) {
189+
this.applyLoadingModifier(1)
190+
}
188191
this.loading = true
189192
}
190193

0 commit comments

Comments
 (0)