Builder
A Builder used to create instances of ApolloClient.
Properties
Functions
Adds the given customScalarAdapter to this ApolloClient.
Adds a HttpHeader to the ApolloClient headers. The ApolloClient headers are added to the ApolloCall headers.
Adds httpInterceptor to the list of HTTP interceptors
Adds an ApolloInterceptor to this ApolloClient.
Adds several ApolloInterceptors to this ApolloClient.
Configures auto persisted queries.
Creates an ApolloClient from this Builder
Whether this operation can be batched.
When conflateResponses is true, the fetch policy interceptors emit a single response and ignores the first cache or network error if a successful response is ultimately fetched. If no successful response can be emitted, a com.apollographql.apollo.exception.ApolloCompositeException error response is emitted.
Configures the CustomScalarAdapters.
Sets the CoroutineDispatcher that the return value of ApolloCall.toFlow will flow on.
Whether to enable Auto Persisted Queries (APQs for this operation.
Whether to fail fast if the device is offline. Requires setting an interceptor that is aware of the network state with retryOnErrorInterceptor.
Batch HTTP queries to execute multiple at once. This reduces the number of HTTP round trips at the price of increased latency as every request in the batch is now as slow as the slowest one. Some servers might have a per-HTTP-call cache making it faster to resolve 1 big array of n queries compared to resolving the n queries separately.
The HttpEngine to use for HTTP requests.
Configures whether to expose the error body in ApolloHttpException.
Configures the HttpHeaders to use. These headers are added with the ApolloCall headers.
Adds httpInterceptor to the list of HTTP interceptors.
Configures the HttpMethod to use.
The http:// or https:// url of the GraphQL server.
Sets the ApolloInterceptors on this ApolloClient.
Configures the NetworkTransport to use for queries and mutations.
Configures the ApolloClient to use the callFactory for network requests.
Configures the ApolloClient to use the lazily initialized callFactory for network requests.
Configures the ApolloClient to use the OkHttpClient for network requests. The OkHttpClient will be used for both HTTP and WebSocket requests.
Removes httpInterceptor from the list of HTTP interceptors.
Removes an ApolloInterceptor from this ApolloClient.
Configures the retryOnError default if ApolloRequest.retryOnError is not set.
Sets the ApolloInterceptor used to retry or fail fast a request. The interceptor may use ApolloRequest.retryOnError and ApolloRequest.failFastIfOffline. The interceptor is also responsible for allocating a new ApolloRequest.requestUuid on retries if needed.
Whether to send the Auto Persisted Queries (APQs extensions.
Whether to send the GraphQL Document.
The http:// or https:// url of the GraphQL server.
Configures the NetworkTransport to use for queries and mutations.
The WebSocketEngine to use for WebSocket requests
The timeout after which an inactive WebSocket will be closed
Configure the WebSocketNetworkTransport to reopen the websocket automatically when a network error happens
The url of the GraphQL server used for WebSockets Use this function or webSocketServerUrl((suspend () -> String)) but not both.
Configure dynamically the url of the GraphQL server used for WebSockets. Use this function or webSocketServerUrl(String) but not both.
The WsProtocol.Factory to use for websockets