I was wondering what is the best approach to add network monitoring to apollo kotlin multiplatform code.
internal val apolloClient = ApolloClient.Builder()
.serverUrl(“”)
.addHttpInterceptor(AuthorizationInterceptor(token))
.build()
I was wondering what is the best approach to add network monitoring to apollo kotlin multiplatform code.
internal val apolloClient = ApolloClient.Builder()
.serverUrl(“”)
.addHttpInterceptor(AuthorizationInterceptor(token))
.build()
Hi! Thanks for reaching out.
There is a LoggingInterceptor
that you can use to output the HTTP traffic to any logger. For instance to use it and print directly to the console, you can do:
val apolloClient = ApolloClient.Builder()
.serverUrl("")
.addHttpInterceptor(LoggingInterceptor{ println(it) })
.build()
Let us know if that helps!