Replies: 1 comment 2 replies
-
There isn't really a need to
one way to achieve this is to disable the button that would trigger the mutation (or whatever other ui element does that) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to get data from a query and only run a mutation once the data from that query is available, but it sees like there's no "disabled" option on useMutation?
I also can't do it conditionally because its a hook, any ideas on how to achieve this?
`
export const useUpdatePatient = () => {
const { data: patient } = useCurrentPatient()
return useMutation((vars: UpdatePatientVars) => {
const url =
/patients/patients/${patient?.id}
}, {disabled: !patient?.id})
}
`
Beta Was this translation helpful? Give feedback.
All reactions