Skip to content

Commit c8ab8db

Browse files
author
Guillaume Chau
committed
SmartSubscription: bind updateQuery to vm - fix #154
1 parent 164b7bb commit c8ab8db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/smart-subscription.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export default class SmartSubscription extends SmartApollo {
2424

2525
const apolloOptions = this.generateApolloOptions(variables)
2626

27+
if (typeof apolloOptions.updateQuery === 'function') {
28+
apolloOptions.updateQuery = apolloOptions.updateQuery.bind(this.vm)
29+
}
30+
2731
if (this.options.linkedQuery) {
2832
this.sub = this.options.linkedQuery.subscribeToMore(apolloOptions)
2933
} else {

0 commit comments

Comments
 (0)