Open
Description
Description
Currently, as far as I can tell when data gets mutated, you have to manually update the tanstack
query data in order to update the client state.
const { data, error, refetch } = useQuery("get", "/api/test");
const { mutateAsync } = useMutate("patch", "/api/test");
const handleUpdateClick = async () => {
await mutateAsync({ params: { query: { message: "Message updated by mutate!" } } });
// optionally refresh, etc.
refetch();
};
There should be a clean way to update the query data without additional changes.
Proposal
Either add a parameter, etc. to automatically update the query data.
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)