Hi friends, I have another normalized caching ques...
# apollo-kotlin
f
Hi friends, I have another normalized caching question. It's about
ApolloStore#writeFragment
. Can this be used to update the cache if an object has changed? E.g. let's say I have a
Widget
object with
id=8675309
and so it has a cache key of (say)
Widget:8675309
. This Widget is shared by multiple queries. If I make a Mutation to this widget, and I know the cache key, can I use
writeFragment
to update the cache manually? (this is for a situation where the back end can't return the updated data)
b
yes that's right
don't forget to enable
generateFragmentImplementations.set(true)
in your Gradle conf to be able to build fragments that you can pass to
writeFragment
f
nice thanks!
👍 1