How to turnoff notification message from Hasura?

By default when Hasura dataprovider error occurs there is a notification with full text of error message. I know I can define notification message for every usage of dataprovider by providing property errorNotification but I'd like to turn it off globally (prefer to show blank notification than this error message).
3 Replies
kapa.ai
kapa.ai9mo ago
Hi @Pshemo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To globally disable the error notification in Refine, you can use the errorNotification prop and set it to false. This can be done in the useForm, useDeleteMany, or useCustomMutation hooks, depending on where you want to disable the notification. Here is an example of how to disable the error notification in the useForm hook:
useForm({
errorNotification: false,
});
useForm({
errorNotification: false,
});
You can do the same for the useDeleteMany and useCustomMutation hooks:
const { mutate } = useDeleteMany();
mutate({
errorNotification: false,
});

const { mutate } = useCustomMutation();
mutate({
errorNotification: false,
});
const { mutate } = useDeleteMany();
mutate({
errorNotification: false,
});

const { mutate } = useCustomMutation();
mutate({
errorNotification: false,
});
Please note that the NotificationProvider (https://refine.dev/docs/notification/notification-provider/) is required for this prop to work. Sources: - useForm Documentation (https://refine.dev/docs/core/hooks/use-form#errornotification-) - useDeleteMany Documentation (https://refine.dev/docs/data/hooks/use-delete-many#errornotification) - useCustomMutation Documentation (https://refine.dev/docs/data/hooks/use-custom-mutation#errornotification) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@682280607295733905> kapa.ai is still learning and improving, please let us know how it did by reacting below
conscious-sapphire
conscious-sapphire9mo ago
It's not only about useForm, useDeleteMany etc. It's also about useTable, useOne, useSimpleList etc. I