FieldValue

interface FieldValue<T>(source)

Represents the value of a resolved GraphQL field.

Java equivalent of Kotlin's viaduct.api.FieldValue. Used by batch resolvers to return a per-element success or error for each input context.

Parameters

<T>

the resolved value type

Inheritors

Types

Link copied to clipboard
class Error<T> : Record, FieldValue<T>
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun get(): T
Returns the value on success, or throws the contained exception on error.
Link copied to clipboard
abstract fun isError(): Boolean
Whether this is an error value.
Link copied to clipboard
open fun <T> ofError(error: Exception): FieldValue<T>
Constructs a FieldValue that resolved with the given error.
Link copied to clipboard
open fun <T> ofValue(value: T): FieldValue<T>
Constructs a FieldValue that resolved without an error.