apollo-kotlin
apollo-kotlin copied to clipboard
Need no-op debug server
Use case
import com.apollographql.apollo3.debugserver.ApolloDebugServer will break the release builds since your docs suggest to only include this dependency in the debug build type
Describe the solution you'd like
releaseImplementation("com.apollographql.apollo3:apollo-debug-server-noop:4.0.0-beta.4")
Hi!
You should be able to have the import only in your debug build, by doing something like this:
app/src/debug/kotlin/yourpackage/ApolloDebugServer.kt:
fun ApolloClient.registerApolloDebugServer() {
ApolloDebugServer.registerApolloClient(this)
}
app/src/main/kotlin/yourpackage/ApolloDebugServer.kt:
fun ApolloClient.registerApolloDebugServer() {
// no-op
}
and call it where you configure your client:
val apolloClient = ApolloClient.Builder()
// (...)
.build()
.registerApolloDebugServer()
Here’s an example of that, albeit a tad more complicated because it’s a KMP app.
Would that work for you?
Excellent, thanks!