In the optimisticResponse usage there is talk about adding cache but nothing about deleting…
How to clear cache using optimisticResponse?
URL
const UNLIKE_TRACK_ACTIVITY = gql`
mutation UNLIKE_TRACK($trackId: Int!) {
unlikeTrack: unlike_track(track_id: $trackId) {
id
}
}
`;
const [fetch, { loading }] = useMutation<Result, Args>(UNLIKE_TRACK_ACTIVITY, {
update(cache, { data }) {
...
},
optimisticResponse({ trackActivityId }) {
return {
unlikeTrack: {
????
}
};
}
});