import { gql , useMutation } from "@apollo/client" ; const UpdateThreadPoint = gql `
  mutation UpdateThreadPoint($threadId: ID!, $increment: Boolean!) {
    updateThreadPoint(threadId: $threadId, increment: $increment)
  }
` ; const useUpdateThreadPoint = ( refreshThread ? , threadId ? ) => { const [ execUpdateThreadPoint ] = useMutation ( UpdateThreadPoint ) ; const onClickIncThreadPoint = async ( e ) => { e . preventDefault ( ) ; await execUpdateThreadPoint ( { variables : { threadId , increment : true , } , } ) ; refreshThread && refreshThread ( ) ; } ; const onClickDecThreadPoint = async ( e ) => { e . preventDefault ( ) ; await execUpdateThreadPoint ( { variables : { threadId , increment : false , } , } ) ; refreshThread && refreshThread ( ) ; } ; return { onClickIncThreadPoint , onClickDecThreadPoint , } ; } ; export default useUpdateThreadPoint ;