Closed
Description
Describe the bug
I am trying to make a form submission with Refine, and for some reason anytime I try to receive the data from the mutation, it returns it as undefined but says the mutation was successful. Here's what my backend returns for instance:
{
"id": 37,
"title": "schedule",
"semesterId": "Spring 2025",
"entries": []
}
Steps To Reproduce
const {formProps, modalProps, close, mutationResult} = useModalForm({
action: "create",
defaultVisible: true,
meta: {
select: "*",
gqlMutation: CREATE_CLASS_SCHEDULE_MUTATION,
},
onMutationSuccess: (response) => {
console.log('Full response:', response);
const createdSchedule = response?.data?.createClassSchedule;
if (createdSchedule) {
console.log('Created schedule:', createdSchedule);
onFinish(createdSchedule as ClassSchedule);
close();
onClose();
} else {
console.error('Created schedule data is missing from the response');
}
},
onMutationError: () => {
throw new Error("Failed to create schedule");
},
}
);
Expected behavior
The data should've returned in that aforementioned style, but yet it keeps returning data undefined and context undefined
Packages
- @refinedev/[email protected]
- @refinedev/[email protected]
Additional Context
No response