I'd like to redirect to an error page when my GraphQL API is down instead of showing an empty page because the content couldn't load.
I think I have to do the redirection when Apollo receives an error 503 as a reply but I don't know how I can do that.
Thank you !
You can handle the error with this, in your apollo query.
apollo: {
todos: {
query: GET_MY_TODOS,
error(error) {
console.log(error)
this.$router.push('/db-error-page')
}
},
},