title: How use react-query mutations with axios?
body: <p>I'm trying to use <a href="https://react-query.tanstack.com/docs/guides/mutations" rel="noreferrer">react-query mutations</a> using axios but when my request return an http error my <code>catch()</code> is not being called.</p>
  <p>This is what i tried:</p>
  <pre><code>const BannerRightConfirmEmail = () =&gt; {
    const [{ token }] = useState&lt;ITokenConfirmationEmailParam&gt;(useParams());
    const [mutateConfirmEmail] = useMutation(confirmEmailUser);
  
    useEffect(() =&gt; {
      confirmEmail();
    }, []);
  
    const confirmEmail = async () =&gt; {
      try {
        await mutateConfirmEmail(token);
      } catch (errorReq) {
        console.log(errorReq);
      }
    };
  </code></pre>
  <p>my <strong>user.service.ts</strong>:</p>
  <pre><code>const confirmEmailUser = async (token: string) =&gt; {
    await api.patch('/users/confirmEmail/' + token)
  }
  
  export { confirmEmailUser }
  </code></pre>
  <p><strong>my api.ts:</strong></p>
  <pre><code>const api = axios.create({
    baseURL: &quot;http://localhost:3100&quot;,
  });
  </code></pre>
  <p>My request is returning a 400 error status, but nothing is being printed in my <code>catch()</code>, why?</p>