DEV Community

John Ding
John Ding

Posted on

update local cache after mutation(update/delete/insert)

update(cache, {data}) {
cache.modify({
id: cache.identify({
id: data.response.comment.answerId,
__typename: 'Answer',
}),
fields: {
commentCount(oldCount) {
return oldCount + 1
},
},
})
}

Top comments (0)