Milan Vadhel
10/22/2021, 11:35 AMJeremie
10/22/2021, 3:09 PMbod
10/22/2021, 3:13 PMMilan Vadhel
10/25/2021, 5:32 AMbod
10/25/2021, 6:59 AMMilan Vadhel
10/25/2021, 7:02 AM@Singleton
@Provides
fun provideApolloClient(okHttpClient: OkHttpClient): ApolloClient {
return ApolloClient
.builder()
.addApplicationInterceptor()
.defaultHttpCachePolicy(HttpCachePolicy.NETWORK_FIRST)
.defaultResponseFetcher(ApolloResponseFetchers.NETWORK_FIRST)
.serverUrl(URLConstant.GRAPH_QL_BASE_URL)
.okHttpClient(okHttpClient)
.build()
}
addApplicationInterceptor() is only accepts ApolloInterceptor.bod
10/25/2021, 7:12 AMokHttpClient
🙂 See an example here: https://www.apollographql.com/docs/android/tutorial/10-authenticate-your-queries/Milan Vadhel
10/25/2021, 7:13 AM