https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
f

Frank Sullivan

02/29/2024, 10:50 PM
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

bod

03/01/2024, 8:30 AM
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

Frank Sullivan

03/01/2024, 4:37 PM
nice thanks!
👍 1