plugin-graphql
plugin-graphql copied to clipboard
Help needed: hook for http response headers (401)
I get a response of 401 if I am not authenticated in my graphql api.
Is there a way to centralised catch all errors from apollo and do something with it on 1 place.
Currently not. I'm open for suggestions and Pull Requests :)
@phortx thanks for your fast reply.
Could you maybe help me with another question.
Is there a way to update the options of VuexORM after you do this line
VuexORM.use(VuexORMGraphQL, {options});
Nope. For dynamic behavior there would be a function. Like we're doing it with HTTP Headers.
I suggest something like this:
VuexORM.use(VuexORMGraphQL, {
database: database,
...,
onError(error) {
// handle error here
}
});