GraphQLPathSegment

sealed interface GraphQLPathSegment(source)

Backend-neutral segment of a GraphQL error GraphQLResponseError.path.

A GraphQL error path is a sequence of segments that locates the response field which triggered the error. Each segment is either a named field (Field) or a zero-based list index (Index).

Usage

val path = listOf(
GraphQLPathSegment.Field("viewer"),
GraphQLPathSegment.Field("repositories"),
GraphQLPathSegment.Index(3),
)

See also

Inheritors

Types

Link copied to clipboard
data class Field(val name: String) : GraphQLPathSegment

A named object field on the response path.

Link copied to clipboard
data class Index(val value: Int) : GraphQLPathSegment

A zero-based list index on the response path.