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

io.javalin.plugin.graphql.server.JavalinGraphQLServer.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.*
import io.javalin.http.Context
import io.javalin.plugin.graphql.GraphQLPluginBuilder

class JavalinGraphQLServer(contextFactory: GraphQLContextFactory<*, Context>, requestHandler: GraphQLRequestHandler) : GraphQLServer(
    JavalinGraphQLRequestParser(), contextFactory, requestHandler) {
    companion object {
        fun create(builder: GraphQLPluginBuilder<*>): JavalinGraphQLServer {
            val dataLoaderRegistryFactory = builder.toJavalinDataLoaderRegistryFactory()
            val requestHandler = GraphQLRequestHandler(builder.getSchema(), dataLoaderRegistryFactory)

            return JavalinGraphQLServer(builder.contextFactory, requestHandler)
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy