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

Jacob Rhoda

10/03/2023, 8:49 PM
I have a request which deletes a record on the backend server… What would be the best way to make that update the cache when the request finishes? The result of the mutation is nothing special, just a boolean value.
m

mbonnin

10/03/2023, 9:27 PM
The best way is usually for the mutation to return the updated data in which case the update can be transparent. If that's not an option, you can write to the store directly using
apolloStore.writeFragment()
Since this is a deletion, you'll have to update the place where the object is deleted (list or parent object)