Fork me on GitHub

Is there a way in lacinia-pedestal to set the HTTP status code of a request? My API requires authentication and error handling on the client side would be a lot easier if one could also signal errors on the HTTP protocol level.

Lennart Buit20:08:28

Slight pushback: Although authorization is probably okay to do with status codes (we do so too), its often encouraged in GraphQL to return 200 + error messages, or 200 + some kind of schema error.


Sorry, for asking too soon, the answer is here: Just like that:

(resolve/resolve-as nil {:message "Access denied."
                         :status 403})

👍 6