Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const [upvotePost, { error, loading, data }] = useMutation(UPVOTE_POST, {
  2. variables: { postId: props.post.id, userId: loggedUserId },
  3. refetchQueries: [{ query: POSTS_LIST }]
  4. });
  5.  
  6. if (error) {
  7. error.graphQLErrors.map(error => {
  8. console.log(error);
  9. if (error.extensions.code === "constraint-violation")
  10. toast(`${error.message}`);
  11. });
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement