Dariusz Kuc
02/05/2023, 9:20 PMJorge R
02/14/2023, 9:33 AMDariusz Kuc
02/14/2023, 1:28 PMauthenticate
block does (is it built in? Or some custom logic?)rocketraman
02/14/2023, 4:31 PMauthenticate("auth name")
and it applies the authentication configuration for "auth name". https://ktor.io/docs/authentication.htmlrocketraman
02/14/2023, 4:31 PMDariusz Kuc
02/14/2023, 4:54 PMrocketraman
02/14/2023, 5:04 PMexecute
call. This exception handle creates a standard GraphQLResponse for unhandled exceptions -- otherwise we found unexpected errors weren't handled properly by the client side (a 3rd party project using Elm). I haven't checked the PR but would we still have access to this extension point?rocketraman
02/14/2023, 5:14 PMGraphQLContextFactory
.rocketraman
02/14/2023, 5:15 PMreceiveText
):
override suspend fun parseRequest(request: ApplicationRequest): GraphQLServerRequest = try {
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
// Ktor receiveText uses the rules for plain text, and the default encoding for plain text is ISO-8859-1:
// <https://www.rfc-editor.org/rfc/rfc7231#appendix-B>
// <https://www.rfc-editor.org/rfc/rfc8259.html#section-8.1>
// <https://stackoverflow.com/a/49552784/430128>
// instead -- receive the data as a stream and default to UTF-8
val reader = request.call.receiveStream().reader(request.contentCharset() ?: Charsets.UTF_8)
mapper.readValue(reader, GraphQLServerRequest::class.java)
}
} catch (e: IOException) {
throw IOException("Unable to parse GraphQL payload.", e)
}
Dariusz Kuc
02/14/2023, 10:22 PM