rare-sapphire
rare-sapphire11mo ago

graphql mutation

i am using graphql for and i want to pass different meta fields for getOne and update using useForm how can i do it?
2 Replies
kapa.ai
kapa.ai11mo ago
Hi @Alex YT. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- In Refine, you can pass different meta fields for getOne and update using the useForm hook. You can use the queryMeta and mutationMeta properties for this purpose. The queryMeta property is used to pass additional information to the useOne hook that is used to fetch the data in the edit and clone modes. Here is an example of how you can use it:
useForm({
queryMeta: {
querySpecificValue: "someValue",
},
});
useForm({
queryMeta: {
querySpecificValue: "someValue",
},
});
The mutationMeta property is used to pass additional information to the useCreate or useUpdate hook mutations. Here is an example of how you can use it:
useForm({
mutationMeta: {
mutationSpecificValue: "someValue",
},
});
useForm({
mutationMeta: {
mutationSpecificValue: "someValue",
},
});
If you have overlapping properties in both meta and queryMeta or mutationMeta, the queryMeta or mutationMeta property will be used respectively. For more information, you can refer to the following documentation pages: - React-hook-form useForm Properties queryMeta (https://refine.dev/docs/packages/react-hook-form/use-form#querymeta) - React-hook-form useForm Properties mutationMeta (https://refine.dev/docs/packages/react-hook-form/use-form#mutationmeta) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai11mo ago
<@398749213795680259> kapa.ai is still learning and improving, please let us know how it did by reacting below