solid-orange
solid-orange9mo ago

useForm disable useOne

Hello i read the docs and the edit action is calling automatically useOne(), is any method to disable this useOne hook ?
3 Replies
kapa.ai
kapa.ai9mo ago
Hi @Gas-Moraa. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The documentation does not provide a direct way to disable the useOne hook within the useForm hook. The useForm hook in Refine is designed to automatically handle data fetching and mutation logic, including the use of useOne, useUpdate, and useCreate hooks. If you want to customize the data fetching behavior, you might need to use these hooks separately or create a custom hook. I recommend checking the documentation for more details: - useForm documentation (https://refine.dev/docs/data/hooks/use-form) - useOne documentation (https://refine.dev/docs/data/hooks/use-one/) - useUpdate documentation (https://refine.dev/docs/data/hooks/use-update/) - useCreate documentation (https://refine.dev/docs/data/hooks/use-create/) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@597180208310910977> kapa.ai is still learning and improving, please let us know how it did by reacting below
wee-brown
wee-brown9mo ago
Hey @Gas-Moraa You can pass queryOptions: { enabled: false } to your useForm hook, to disable get query for your edit page. https://refine.dev/docs/data/hooks/use-form/#queryoptions
useForm | Refine
A hook that orchestrates Refine's data hooks to create, edit, and clone data. It also provides a set of features to make it easier for users to implement their real world needs and handle edge cases such as redirects, invalidation, auto-save and more.