ApolloCall

class ApolloCall<D : Operation.Data> : MutableExecutionOptions<ApolloCall<D>>

An ApolloCall is a thin class that builds a ApolloRequest and calls ApolloClient.execute() with it. ApolloCall is mutable and designed to allow chaining calls.

Functions

Link copied to clipboard
open override fun addExecutionContext(executionContext: ExecutionContext): ApolloCall<D>
Link copied to clipboard
open override fun addHttpHeader(name: String, value: String): ApolloCall<D>

Adds an HTTP header to be sent with the request. This HTTP header is added on top of any existing ApolloClient header. If you want to replace the headers, use httpHeaders instead.

Link copied to clipboard
open override fun canBeBatched(canBeBatched: Boolean?): ApolloCall<D>
Link copied to clipboard
fun copy(): ApolloCall<D>
Link copied to clipboard
open override fun enableAutoPersistedQueries(enableAutoPersistedQueries: Boolean?): ApolloCall<D>
Link copied to clipboard
suspend fun execute(): ApolloResponse<D>

A shorthand for toFlow().single(). Use this for queries and mutation to get a single ApolloResponse from the network or the cache. For subscriptions, you usually want to use toFlow instead to listen to all values.

Link copied to clipboard
open override fun httpHeaders(httpHeaders: List<HttpHeader>?): ApolloCall<D>

Sets the HTTP headers to be sent with the request. This method overrides any HTTP header previously set on ApolloClient

Link copied to clipboard
open override fun httpMethod(httpMethod: HttpMethod?): ApolloCall<D>
Link copied to clipboard
open override fun sendApqExtensions(sendApqExtensions: Boolean?): ApolloCall<D>
Link copied to clipboard
open override fun sendDocument(sendDocument: Boolean?): ApolloCall<D>
Link copied to clipboard
fun toFlow(): Flow<ApolloResponse<D>>

Returns a cold Flow that produces ApolloResponses for this ApolloCall. Note that the execution happens when collecting the Flow. This method can be called several times to execute a call again.

Properties

Link copied to clipboard
open override var canBeBatched: Boolean? = null
Link copied to clipboard
open override var enableAutoPersistedQueries: Boolean? = null
Link copied to clipboard
open override var executionContext: ExecutionContext
Link copied to clipboard
open override var httpHeaders: List<HttpHeader>? = null
Link copied to clipboard
open override var httpMethod: HttpMethod? = null
Link copied to clipboard
val operation: Operation<D>
Link copied to clipboard
open override var sendApqExtensions: Boolean? = null
Link copied to clipboard
open override var sendDocument: Boolean? = null