class GropiusFunctionDataFetcher(val target: Any?, val function: KFunction<*>, applicationContext: ApplicationContext) : SpringDataFetcher

FunctionDataFetcher which handles files parameter mapping for parameters of GraphQL type JSON correctly Allows input classes to have lateinit properties which are correctly deserialized. Also handles wrapping the result of a mutation when using AutoPayloadType Extends SpringDataFetcher

Parameters

target

if present, the object on which the function is invoked

function

the function the data fetcher calls

applicationContext

used to obtain Spring beans

Constructors

Link copied to clipboard
constructor(target: Any?, function: KFunction<*>, applicationContext: ApplicationContext)

Properties

Link copied to clipboard
private val applicationContext: ApplicationContext
Link copied to clipboard
private val fn: KFunction<*>
Link copied to clipboard
private val function: KFunction<*>
Link copied to clipboard
private val target: Any?
private val target: Any?

Functions

Link copied to clipboard
open operator override fun get(environment: DataFetchingEnvironment): Any?
Link copied to clipboard
protected open fun getParameters(fn: KFunction<*>, environment: DataFetchingEnvironment): Map<KParameter, Any?>
Link copied to clipboard

Handles the AutoPayloadType annotation if present

Link copied to clipboard
protected open override fun mapParameterToValue(param: KParameter, environment: DataFetchingEnvironment): Pair<KParameter, Any?>?
Link copied to clipboard
protected open fun runBlockingFunction(parameterValues: Map<KParameter, Any?>): Any?
Link copied to clipboard
private fun runMutationFunction(environment: DataFetchingEnvironment): CompletableFuture<Any?>

Invokes the mutation function and handles transient exceptions

Link copied to clipboard
private fun runMutationFunctionWithRetries(environment: DataFetchingEnvironment): CompletableFuture<Any?>

Invokes the mutation function and handles transient exceptions

Link copied to clipboard
protected open fun runSuspendingFunction(environment: DataFetchingEnvironment, parameterValues: Map<KParameter, Any?>): CompletableFuture<Any?>