forType

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

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.

This can be used when the caller handles JSON with an expected type, and that type is not encoded in the JSON in the form of a "__typename" key.

For use-cases where the decoded type is not always known, but the input json includes a __typename key, see invoke.

See also