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
Current resolver do not have gin context that means and method only returns err
What did you expect?
Want to have custom error code like ctx.JSON(http.StatusNotFound, responseBody) but gqlgen only handles it by returning array of error, is there any way to solve this?
The text was updated successfully, but these errors were encountered:
GraphQL is sort of protocol-agnostic, so you are correct that it does not provide guidelines for HTTP status codes, but that doesn't mean this implementation of GraphQL over HTTP should not support status codes other than 200 or 422.
http status codes in GraphQL are usually used when the actual grapql layer is unable to respond due to an error like authentication, internal server errors, bad gateway, etc.., but when are inside a resolver, i don't see a reason to respond with particular http status code, if you want to add additional context to an error you can always extend the errors with extensions as mentioned here https://gqlgen.com/reference/errors/
What happened?
Current resolver do not have gin context that means and method only returns err
What did you expect?
Want to have custom error code like
ctx.JSON(http.StatusNotFound, responseBody)
but gqlgen only handles it by returning array of error, is there any way to solve this?The text was updated successfully, but these errors were encountered: