JsonDomain

A mapping Domain that converts between json-formatted Strings describing object values and IR.Value.Objects

Functions

Link copied to clipboard
fun <T : CompositeOutput> forSelectionSet(ctx: ExecutionContext, selectionSet: SelectionSet<T>): Domain<String>

Create a Domain that maps json-encoded strings corresponding to the given selectionSet

Link copied to clipboard
@JvmName(name = "forInputType")
fun <T : Input> forType(ctx: ExecutionContext, type: Type<T>): Domain<String>
@JvmName(name = "forObjectType")
fun <T : Object> forType(ctx: ExecutionContext, type: Type<T>): Domain<String>

Create a Domain that translates json-encoded strings into the IR representation of type. The returned Domain will expect all input values to be JSON-encoded representations of type.

Link copied to clipboard
operator fun invoke(ctx: ExecutionContext): Domain<String>

Create a Domain that translates json-encoded strings of unknown types into IR.Value.Object representations.