title: how to call reactQuery refetch in input onchange event in reactjs
body: <p>In my React application, I need to call does exit API. API call should happen when change event in the input for that, I am using the reactQuery refetch to do that.</p>
  <p>I had tried with below code</p>
  <p><code>const [createObj, setCreateObj] = useState(mCreateObj);</code></p>
  <p><code>const { data: doexit, refetch: doexitRefetch } = useQuery('getDoexit', () =&gt; api.doexitAPI(createObj.c_name), { enabled: false });</code></p>
  <p><code>const handleInput = ({ target: { name, value } }) =&gt; { setCreateObj(state =&gt; ({ ...state, [name]: value }), []); }</code></p>
  <p><code>export const doexitAPI= (value) =&gt; axios.get(</code>/doexist/${value}<code>, { headers: setHeader }).then(res =&gt; res);</code></p>
  <p><code>useEffect(() =&gt; { console.log(createObj) doexitRefetch();    }, [createObj.mx_name])</code></p>
  <p>How to call in input onchange event</p>