plugins – How to return custom response (code and body) with wpgraphql?

I am new to both php and wordpress logic (filters and actions). I am trying to write my own authentication middleware, by parsing and validating a JWT created by a third party provider.
I am trying to make use of determine_current_user, graphql_authentication_errors and init_graphql_request and so far so good. My problem is that if the token is valid, everything goes as expected. But I have a piece of code (I found online) like that:

catch(FirebaseJWTExpiredException $e) {
    throw ...
} catch(FirebaseJWTSignatureInvalidException $e) {
    throw ...
} catch(FirebaseJWTBeforeValidException $e) {
    throw ...

What I am trying to do is find a way to return a different response for each case. Currently, the only response i am getting is 500 internal server error which makes sense. How should I return a different response object ? Which is the best wordpress API (or graphql) practise to do so ?