You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @alexsteinerde,
How can I return response code other that 200 for specific scenarios (unauthorized etc)?
I've tried adding a custom error middleware but because RoutesBuilder status is always ok I it never uses it.
The text was updated successfully, but these errors were encountered:
Hi,
this isn't supported at the moment. If you like you can create a PR for this.
Currently I don't have any specific ideas on how to implement that but it could probably be done by analyzing the returned GraphQLResult error array.
After a second thought I came up with an idea on how this could be implemented.
We could introduce a protocol that your custom errors would conform to. Then we could check on that new error type and extract the status code from that which would be returned as the response.
Sorry for late response.
I liked your solution, I played with it a bit but eventually I felt like were ignoring GraphQL best practices, and other users in the future might miss the point and abuse it.
I tried to go for a high level solution here.
WDYT?
Hi @alexsteinerde,
How can I return response code other that 200 for specific scenarios (unauthorized etc)?
I've tried adding a custom error middleware but because
RoutesBuilder
status is always ok I it never uses it.The text was updated successfully, but these errors were encountered: