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.
Sets the ApolloInterceptor used for auto persisted queries.
Creates an ApolloClient from this Builder
Sets the ApolloInterceptor used for caching.
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 httpInterceptors to the list of HTTP interceptors.
Configures the HttpMethod to use.
Sets the default http:// or https:// url of the GraphQL endpoint.
Sets whether to ignore the unknown keys in the JSON response.
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 for this com.apollographql.apollo.ApolloClient.
Sets the ApolloInterceptor used to retry or fail fast a request. The interceptor may use ApolloRequest.retryOnError and ApolloRequest.failFastIfOffline.
Whether to send the Auto Persisted Queries (APQs extensions.
Whether to send the GraphQL Document.
Configures whether client library metadata is sent in each request extensions key. Client library metadata is the Apollo Kotlin library name and version.
Sets the default http:// or https:// url of the GraphQL endpoint.
Configures the NetworkTransport to use for subscriptions.
Configures the url to use for every request. This applies to every request, including subscriptions. This url is set in the request ExecutionContext and takes precedence over serverUrl and webSocketServerUrl. You may use an interceptor to change the url based on the incoming ApolloRequest.
The DeprecatedWebSocketEngine 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
Sets the default url of the GraphQL websockets endpoint.
Configure dynamically the url of the GraphQL server used for WebSockets. Use this function or webSocketServerUrl(String) but not both.
The DeprecatedWsProtocol.Factory to use for websockets