Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Docs
Start for Free

Troubleshooting


If you are experiencing cache misses, check your cache size and eviction policy. Some records might have been removed from the cache. Increasing the cache size and/or retention period will help hitting your cache more consistently.

If you are still experiencing cache misses, you can dump the contents of the cache:

val dump = apolloClient.apolloStore.dump()
println(NormalizedCache.prettifyDump(dump))

A ical normalized cache viewer is also available in the Android Studio plugin.

Make sure that no data is duplicated in the dump. If it is the case, it probably means that some objects have a wrong CacheKey. Make sure to provide a CacheKeyResolver that can work with your graph. All objects should have a unique and stable cache ID. That means that the cache ID should be the same no matter what path the object is in the graph. That also mean you have to include the key (s) in your queries to be able to use them in the CacheKeyResolver.

Finally, make sure to design your queries so that you can reuse . A single missing field in the cache for a will trigger a network fetch. Sometimes it might be useful to query an extra field early on so that it can be reused by other later queries.

Previous
HTTP cache
Next
Interceptors
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company