Metadata

data class Metadata @JvmOverloads constructor(val fieldName: String? = null, val parentType: String? = null, val operationName: String? = null, val isFrameworkError: Boolean? = null, val resolvers: List<String>? = null, val executionPath: List<Any>? = null, val sourceLocation: SourceLocation? = null, val requestContext: Any? = null, val componentName: String? = null, val isSuboperation: Boolean = false)(source)

Metadata about a resolver error including execution context.

This class encapsulates various details about the error, such as the field name, parent type, operation name, whether it is a framework error, the resolvers involved, and execution context.

Constructors

Link copied to clipboard
constructor(fieldName: String? = null, parentType: String? = null, operationName: String? = null, isFrameworkError: Boolean? = null, resolvers: List<String>? = null, executionPath: List<Any>? = null, sourceLocation: SourceLocation? = null, requestContext: Any? = null, componentName: String? = null, isSuboperation: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val componentName: String? = null

The component name associated with the field definition.

Link copied to clipboard
val executionPath: List<Any>? = null

The execution path to the field where the error occurred.

Link copied to clipboard
val fieldName: String? = null

The name of the field where the error occurred.

Link copied to clipboard

Indicates whether the error is a framework error or caused by a tenant.

Link copied to clipboard
val isSuboperation: Boolean = false

Whether this error occurred inside a suboperation (e.g. a derived field provider execution). Suboperations have different fatality semantics for some exception types.

Link copied to clipboard
val operationName: String? = null

The name of the operation where the error occurred.

Link copied to clipboard
val parentType: String? = null

The type of the parent object where the error occurred.

Link copied to clipboard
val requestContext: Any? = null

The request context provided as an input to Viaduct.execute

Link copied to clipboard
val resolvers: List<String>? = null

The list of resolvers involved in the error, represented as a string of the class name.

Link copied to clipboard
val sourceLocation: SourceLocation? = null

Source location in the GraphQL query document where the field was requested.

Functions

Link copied to clipboard

Returns the subset of Metadata fields that are appropriate as GraphQL error extensions (fieldName, parentType, operationName, isFrameworkError, resolvers). Not all fields are included — requestContext and executionPath are omitted intentionally.

Link copied to clipboard
open override fun toString(): String