SHARE
TWEET

Untitled

a guest Oct 15th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top