ApolloResponse

Represents a GraphQL response. GraphQL responses can be partial responses, so it is valid to have both data != null and exception != null

Valid states are:

  • data != null && exception == null: complete data with no error

  • data == null && exception != null: no data, a network error or operation error happened

  • data != null && exception != null: partial data with field errors

Types

Link copied to clipboard

Properties

Link copied to clipboard

Parsed response of GraphQL operation execution. data is non-null if some data is received from the server. data might contain partial data in case of field errors

Link copied to clipboard
@get:JvmName(name = "dataAssertNoErrors")
val dataAssertNoErrors: D

A shorthand property to get a non-nullable data if handling partial data is not important

Link copied to clipboard

GraphQL errors returned by the server to let the client know that something has gone wrong.

Link copied to clipboard

An ApolloException if a GraphQL response wasn't received.

Link copied to clipboard

The context of GraphQL operation execution. This can contain additional data contributed by interceptors.

Link copied to clipboard

Extensions of GraphQL protocol, arbitrary map of key String / value Any sent by server along with the response.

Link copied to clipboard

Indicates that this ApolloResponse is the last ApolloResponse in a given Flow and that no other items are expected.

Link copied to clipboard

The GraphQL operation this response represents

Link copied to clipboard

Functions

Link copied to clipboard
fun dataOrThrow(): D

Return data if not null or throws NoDataException else

Link copied to clipboard
Link copied to clipboard