#How to access mutationState in v4? What is the pattern to work on project with many mutations?
10 messages · Page 1 of 1 (latest)
Yeah that’s nice
setQueryData is not updating state of another component.
I do:
onSuccess: (data) => {
queryClient.setQueryData(
[QUERY_KEY_REGISTERED_INVOICE, {barcode: data?.barcode}],
data,
);
},
but in another component getQueryData is not called again
I dont have GET method. So i just want to get updated data by key and rerender component, is it possible?
ok, that somehow works without fetchFn
I get errors in console: " Missing queryFn for queryKey '["registeredInvoice",{"barcode":"1110339131184383"}] "
But i still get data and evrth works. Can i work with it?
anyone?
Yea, provide some queryFn and set enabled: false
Ok, thank you for your answers. Do i understand right, that in v5 i can use useMutationState for that purpose more correctly?