kgraphql / com.apurebase.kgraphql.schema.dsl / UnionPropertyDSL

UnionPropertyDSL

class UnionPropertyDSL<T : Any> : LimitedAccessItemDSL<T>, Target

Constructors

<init>

UnionPropertyDSL(name: String, block: UnionPropertyDSL<T>.() -> Unit)

Properties

name

val name: String

nullable

var nullable: Boolean

returnType

lateinit var returnType: TypeID

Functions

accessRule

fun accessRule(rule: (T, Context) -> Exception?): Unit

addInputValues

fun addInputValues(inputValues: Collection<InputValueDef<*>>): Unit

resolver

fun resolver(function: suspend (T) -> Any?): ResolverDSL
fun <E> resolver(function: suspend (T, E) -> Any?): ResolverDSL
fun <E, W> resolver(function: suspend (T, E, W) -> Any?): ResolverDSL
fun <E, W, Q> resolver(function: suspend (T, E, W, Q) -> Any?): ResolverDSL
fun <E, W, Q, A> resolver(function: suspend (T, E, W, Q, A) -> Any?): ResolverDSL
fun <E, W, Q, A, S> resolver(function: suspend (T, E, W, Q, A, S) -> Any?): ResolverDSL
fun <E, W, Q, A, S, B> resolver(function: suspend (T, E, W, Q, A, S, B) -> Any?): ResolverDSL
fun <E, W, Q, A, S, B, U> resolver(function: suspend (T, E, W, Q, A, S, B, U) -> Any?): ResolverDSL
fun <E, W, Q, A, S, B, U, C> resolver(function: suspend (T, E, W, Q, A, S, B, U, C) -> Any?): ResolverDSL

setReturnType

fun setReturnType(type: KType): Unit

toKQLProperty

fun toKQLProperty(union: Union): Union<T>