Open J-Rigondo opened 1 year ago
The order of the links matters change your code to:
final Link link = errorLink.concat(authLink.concat(httpLink));
and it will work.
PS. Also onGraphQLError
expects stream of response type so you should change the function to
onGraphQLError: (request, forward, response) async* {
...
}
And return the forward like this:
yield* forward(newReq);
``Hello ! when user send request, access token expired, server will response error, my GraphqlClient's ErrorLink catch onGraphQLError, on this handler do that get new access token and change only request header, and retry request. but forward method not working. I use graphql_codgen, so I don't want use dio. I think get refresh token in AuthLink bad. server have token validation role. How to implement this use your library?