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 b6e8ec3 commit 255d8f5Copy full SHA for 255d8f5
packages/vue-apollo/src/smart-subscription.js
@@ -19,6 +19,14 @@ export default class SmartSubscription extends SmartApollo {
19
}
20
21
22
+ generateApolloOptions (variables) {
23
+ const apolloOptions = super.generateApolloOptions(variables)
24
+
25
+ apolloOptions.onError = this.catchError.bind(this)
26
27
+ return apolloOptions
28
+ }
29
30
executeApollo (variables) {
31
const variablesJson = JSON.stringify(variables)
32
if (this.sub) {
@@ -67,4 +75,13 @@ export default class SmartSubscription extends SmartApollo {
67
75
this.options.result.call(this.vm, data, this.key)
68
76
69
77
78
79
+ catchError (error) {
80
+ super.catchError(error)
81
+ // Restart the subscription
82
+ if (!this.skip) {
83
+ this.stop()
84
+ this.start()
85
86
70
87
0 commit comments