Closed ghost closed 3 years ago
When deleting a comment in singlePost view i ll get this error my code looks like this :
`
const [deletePostOrMutation] = useMutation(mutation, { update(proxy, result) { setModalShow(false); if (!commentId) { const data = proxy.readQuery({ query: FETCH_POSTS_QUERY }); let newData = [...data.getPosts]; newData = data.getPosts.filter((p) => p.id !== postId); proxy.writeQuery({ query: FETCH_POSTS_QUERY, data: { ...data.getPosts, getPosts: { newData } } }); } if (callback) callback(); }, variables: { postId, commentId } })`
What am i missing here ? Thanks
When deleting a comment in singlePost view i ll get this error my code looks like this :
`
What am i missing here ? Thanks