feat(errorHandler): added options arg

This commit is contained in:
Guillaume Chau
2019-10-20 15:54:33 +02:00
parent aea6c938cb
commit 932c5b90a7
+3 -1
View File
@@ -13,6 +13,7 @@ export default class SmartApollo {
this._pollInterval = null
this._watchers = []
this._destroyed = false
this.lastApolloOptions = null
if (autostart) {
this.autostart()
@@ -134,6 +135,7 @@ export default class SmartApollo {
generateApolloOptions (variables) {
const apolloOptions = omit(this.options, this.vueApolloSpecialKeys)
apolloOptions.variables = variables
this.lastApolloOptions = apolloOptions
return apolloOptions
}
@@ -171,7 +173,7 @@ export default class SmartApollo {
catchError (error) {
addGqlError(error)
const catched = this.errorHandler(error, this.vm, this.key, this.type)
const catched = this.errorHandler(error, this.vm, this.key, this.type, this.lastApolloOptions)
if (catched) return