All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.javalin.plugin.graphql.server.JavalinGraphQLRequestParser.kt Maven / Gradle / Ivy

There is a newer version: 4.6.8
Show newest version
package io.javalin.plugin.graphql.server

import com.expediagroup.graphql.server.execution.GraphQLRequestParser
import com.expediagroup.graphql.server.types.GraphQLServerRequest
import io.javalin.http.Context
import java.io.IOException

class JavalinGraphQLRequestParser : GraphQLRequestParser {

    @Suppress("BlockingMethodInNonBlockingContext")
    override suspend fun parseRequest(context: Context): GraphQLServerRequest = try {
        context.bodyAsClass(GraphQLServerRequest::class.java)
    } catch (e: IOException) {
        throw IOException("Unable to parse GraphQL payload.")
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy