How to set the timeout in Kotlin client?

HI,

I have a long time taking request. I added the timeout like this

val apolloClient = ApolloClient.Builder()
        .serverUrl("something")
        .addHttpHeader("Authorization", "Bearer $token")
        .httpEngine(DefaultHttpEngine(timeoutMillis = 10_000))
        .build()

But still I am getting this exception: ApolloHttpException: Http request failed with status code 504`` . And I have tried increase the timeout, but it has zero affect.

What am I doing wrong here?

Hi!

The 504 code error indicates that the time-out you are seeing doesn’t come from the client, but from a gateway on the backend side. This probably means that you should contact the backend team if possible, as something is probably malfunctioning there.

Aah ha. I see. thank you for the help :slight_smile: