Open justinr1234 opened 4 years ago
Hi, I am having a similar issue, I'm using apollo + okhttp on android and am trying to refresh my jwt access token when Hasura's Graphql endpoint returns JWTExpired, but I can't do that since it uses the status code 200 instead of 401.
Has anyone found a solution? I'm using Ktor and okhttpclient having defined the refreshToken behavior (triggered on return of a 401 response status). But hasura returns status 200 for the JWT Expired error. I'm interested in a solution, even if it's a patch.
Very similar to this issue: https://github.com/apollographql/apollo-server/issues/1193#issue-333617316
I am seeing an error when the JWT token is expired, hasura is returning a 200 OK status despite having errors. This happens when there are batched queries going on. For single queries, Hasura returns a proper error. I believe Hasura should be returning an error response for each of the batched queries.
I would expect hasura should return a 401 status code.
In the non-batch case, it is only returning a 400 code: https://github.com/hasura/graphql-engine/blob/4c9362c91b7d5b302e37498d6d5d4971caa630a4/server/src-lib/Hasura/Server/Auth/JWT.hs#L356
For the batch case, I'm not sure.
As a workaround, I have implemented an apollo link that looks like this:
Relevant error stack: