org.ryoframework.exposition.adapters.DefaultGraphQLEngineImpl.kt Maven / Gradle / Ivy
The newest version!
package org.ryoframework.exposition.adapters
import graphql.ExceptionWhileDataFetching
import graphql.ExecutionInput
import graphql.GraphQL
import org.ryoframework.exposition.graphql.GraphQLEngine
import org.ryoframework.exposition.graphql.GraphQLRequest
import org.ryoframework.exposition.graphql.GraphQLResponse
internal class DefaultGraphQLEngineImpl(private val graphQL: GraphQL) : GraphQLEngine {
override fun execute(request: GraphQLRequest): GraphQLResponse {
val executionInput = ExecutionInput.newExecutionInput().query(request.query)
.operationName(request.operationName)
.variables(request.variables)
.build()
val executionResult = graphQL.execute(executionInput)
val data = executionResult.getData