Is it possible to wrap errors in 200 OK responses ...
# kgraphql
l
Is it possible to wrap errors in 200 OK responses (
wrapErrors
in
GraphQL.Configuration
) but also log them into the console at the same time (behaviour with
wrapErrors
set to false)?
j
the only thing that
wrapErrors = true
does is it has a try/catch block on the whole execution and provides a
GraphQLError
exception when any exception happens. Which means (if using ktor) you can easily setup status pages to respond how ever you want
l
I believe it does not work though (I have also tried it), since the KGraphQL itself intercepts this exception and converts it to a 200 OK string.
j
thats correct 😮 We should probably write logs via https://ktor.io/docs/logging.html#access_logger in that code block