Operations are being batched even when batching is disabled by default

Hi Team, :wave:

I’ve the apollo client with httpBatching disabled by default:-

val apolloClient = ApolloClient
                .addCustomScalarAdapter(Date.type, dateCustomTypeAdapter)
                .httpBatching(10, 10, false)

My assumption is that if I execute operations below using the client defined above, they would not be batched.

val result1 = async {
    val result2 = async {

But what I notice is that these operations are batched. Is this expected?
Based on my understanding they shouldn’t, because the apolloClient does not have batching enabled by default.

I just wanted to make sure my understanding is correct.

@mbonnin any suggestions!

You are 100% correct, this is a bug. Fix is there.

In the meantime, you can enable/disable batching per-query:


If this is in many places, you can write a small extension function:

fun <D : Query.Data> ApolloClient.queryBatchingDisabled(query: Query<D>): ApolloCall<D> {
    return query(query).canBeBatched(false)
1 Like