graphql

defa 2020-08-13T09:03:43.000100Z

@hlship that’s reasonable and an API would be much appreciated. Thanks!

defa 2020-08-13T09:06:02.002800Z

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.

defa 2020-08-13T09:07:41.003200Z

Sorry, for asking too soon, the answer is here: https://lacinia-pedestal.readthedocs.io/en/latest/response.html Just like that:

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

2👍
hlship 2020-08-13T19:31:25.004500Z

Good chance to provide a patch! Tests expected, of course.

2020-08-13T20:22:28.004700Z

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.