Our GraphQL backend is built to respond with 403 on authentication error. In that case I would like the Flutter app to throw away the old API token and redirect to a sign in screen. I tried to do this with ErrorLink, and it does catch the error. But I've not found a way to extract the HTTP status code from the ErrorResponse. Is there any way to do that?
Ran into exactly the same problem.
Going beyond the original question, what's the best way to implement token renewal and general retry for gateway failures in graphql 3.1.0?
To answer half of my question, https://github.com/felangel/fresh/tree/master/packages/fresh_graphql seems to work well for token renewal.
In v4 you should be able to get HttpLinkResponseContext from the response, which has the status code
Most helpful comment
In
v4you should be able to getHttpLinkResponseContextfrom the response, which has the status code