convertTo

fun convertTo(type: KClass<*>, context: Context?): InputValue<*>?

Return

a new typed InputValue, automatically determined from type, or null if it could not be converted

Parameters

type

target type to convert this dynamic value to. This type is unwrapped (e.g. if type is String, the output is of type StringValue)

context

context to evaluate the value for

Throws

if the value could not be converted to the target type or if context is required and it's null

if the value could not be converted to an enum entry