httpBatching

open fun httpBatching(batchIntervalMillis: Long, maxBatchSize: Int, enableByDefault: Boolean): ApolloClient.Builder

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.

See also BatchingHttpInterceptor.

Parameters

batchIntervalMillis

the interval between two batches

maxBatchSize

always send the batch when this threshold is reached