GraphQLResponseError

data class GraphQLResponseError(val message: String, val locations: List<GraphQLResponseError.Location>? = null, val path: List<GraphQLPathSegment>? = null, val extensions: GraphQLValue.ObjectValue? = null)(source)

Backend-neutral, spec-compliant GraphQL error entry.

GraphQLResponseError is the neutral counterpart of the legacy co.anitrend.retrofit.graphql.model.attribute.GraphError. Unlike the legacy type, message is required and non-null because a spec-compliant error always carries a message.

Usage

val error = GraphQLResponseError(
message = "Cannot query field 'logins' on type 'User'.",
locations = listOf(GraphQLResponseError.Location(line = 1, column = 10)),
path = listOf(GraphQLPathSegment.Field("viewer")),
)

See also

Constructors

Link copied to clipboard
constructor(message: String, locations: List<GraphQLResponseError.Location>? = null, path: List<GraphQLPathSegment>? = null, extensions: GraphQLValue.ObjectValue? = null)

Types

Link copied to clipboard
data class Location(val line: Int, val column: Int)

Source location of an error within the GraphQL document.

Properties

Link copied to clipboard

Optional additional error metadata represented by a neutral JSON object.

Link copied to clipboard

Optional source locations in the GraphQL document.

Link copied to clipboard

Required description of the error.

Link copied to clipboard

Optional response path segments that triggered the error.