We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83b5473 commit d81ba4fCopy full SHA for d81ba4f
app/src/main/java/guide/graphql/toc/data/Apollo.kt
@@ -1,11 +1,17 @@
1
packageguide.graphql.toc.data
2
3
importcom.apollographql.apollo.ApolloClient
4
+importcom.apollographql.apollo.cache.normalized.lru.EvictionPolicy
5
+importcom.apollographql.apollo.cache.normalized.lru.LruNormalizedCacheFactory
6
7
object Apollo{
8
val client:ApolloClient by lazy{
9
+val cacheFactory =
10
+LruNormalizedCacheFactory(EvictionPolicy.builder().maxSizeBytes(10*1024*1024).build())
11
+
12
ApolloClient.builder()
13
.serverUrl("https://api.graphql.guide/graphql")
14
+ .normalizedCache(cacheFactory)
15
.build()
16
}
-}
17
+}
0 commit comments