Package com.trib3.graphql.execution

Types

ContextScopeFunctionDataFetcher
Link copied to clipboard
open class ContextScopeFunctionDataFetcher(target: Any?, fn: KFunction<*>, objectMapper: ObjectMapper) : FunctionDataFetcher, CoroutineScope

FunctionDataFetcher that tries to run suspend functions in a CoroutineScope provided by the DataFetchingEnvironment.getContext, if the context is a CoroutineScope. Otherwise runs in a scope with Dispatchers.Default.

open class ContextScopeKotlinDataFetcherFactoryProvider(objectMapper: ObjectMapper) : SimpleKotlinDataFetcherFactoryProvider

SimpleKotlinDataFetcherFactoryProvider subclass that provides a ContextScopeFunctionDataFetcher to allow for structured concurrency based on the scope in the GraphQL context.

CustomDataFetcherExceptionHandler
Link copied to clipboard
class CustomDataFetcherExceptionHandler : DataFetcherExceptionHandler

Custom Exception Handler implantation allowing control over sanitation, relevance and specificity

GraphQLAuth
Link copied to clipboard
annotation class GraphQLAuth(roles: Array<String>)

Annotation to be used on field definitions to restrict access based on the context Principal's role. If no roles are specified, any authenticated Principal will be authorized to access the annotated field.

GraphQLAuthDirectiveWiring
Link copied to clipboard
class GraphQLAuthDirectiveWiring(authorizer: Authorizer<Principal>?) : KotlinSchemaDirectiveWiring

Directive wiring that checks for auth before fetching data.

GraphQLRequest
Link copied to clipboard
data class GraphQLRequest(query: String, variables: Map<String, Any>?, operationName: String?)

A generic GraphQL Request object that includes query, variable, and operationName components

JsonSafeExecutionResultMixin
Link copied to clipboard
interface JsonSafeExecutionResultMixin : ExecutionResult

Jackson mixin for ExecutionResults that ensures keys for data/errors/extensions only get written if there is corresponding data. Similar to ExecutionResult.toSpecification, but keeps the object typed as an ExecutionResult instead of converting to a Map

LeakyCauldronHooks
Link copied to clipboard
class LeakyCauldronHooks @Inject constructor(@Nullable authorizer: Authorizer<Principal>?, manualWiring: Map<String, KotlinSchemaDirectiveWiring>) : FlowSubscriptionSchemaGeneratorHooks

Schema generator hooks implementation that defines scalars for java.time (and threeten-extras) objects and wires up the @GraphQLAuth directive.

MessageGraphQLError
Link copied to clipboard
class MessageGraphQLError(msg: String?) : GraphQLError

Simple GraphQLError implementation that only specified an error message

RequestIdInstrumentation
Link copied to clipboard
class RequestIdInstrumentation : SimpleInstrumentation

Instruments a GraphQL response's extensions with the RequestId stored in the logging MDC by the RequestIdFilter

SanitizedGraphQLError
Link copied to clipboard
class SanitizedGraphQLError(path: ResultPath, exception: Throwable, sourceLocation: SourceLocation) : ExceptionWhileDataFetching

Removes exception from the error JSON serialization keeping it out of the API response and attempts to bubble up the message from the root cause of the exception

Functions

toExecutionInput
Link copied to clipboard
fun GraphQLRequest.toExecutionInput(contextMap: Map<*, Any>? = null, dataLoaderRegistryFactory: DataLoaderRegistryFactory? = null): ExecutionInput

Extension function to convert a GraphQLRequest to an ExecutionInput

Properties

LOCAL_DATE_SCALAR
Link copied to clipboard
internal val LOCAL_DATE_SCALAR: GraphQLScalarType
LOCAL_DATETIME_SCALAR
Link copied to clipboard
internal val LOCAL_DATETIME_SCALAR: GraphQLScalarType
LOCAL_TIME_SCALAR
Link copied to clipboard
internal val LOCAL_TIME_SCALAR: GraphQLScalarType
log
Link copied to clipboard
private val log: KLogger
OFFSET_DATETIME_SCALAR
Link copied to clipboard
internal val OFFSET_DATETIME_SCALAR: GraphQLScalarType
UUID_SCALAR
Link copied to clipboard
internal val UUID_SCALAR: GraphQLScalarType
YEAR_MONTH_SCALAR
Link copied to clipboard
internal val YEAR_MONTH_SCALAR: GraphQLScalarType
YEAR_QUARTER_SCALAR
Link copied to clipboard
internal val YEAR_QUARTER_SCALAR: GraphQLScalarType
YEAR_SCALAR
Link copied to clipboard
internal val YEAR_SCALAR: GraphQLScalarType