T
TanStack3y ago
optimistic-gold

Hi all, I'm getting this error when I use QueryClient set/getQueryData:

can't assign to property "exact" on "workspaces": not an object this is my code
queryClient.setQueryData('workspaces', (oldData) => {
return [...oldData, data.data]
});
queryClient.setQueryData('workspaces', (oldData) => {
return [...oldData, data.data]
});
2 Replies
modern-teal
modern-teal3y ago
I think the first argument is your query key which should always be an array
optimistic-gold
optimistic-goldOP3y ago
ok I fix it and no errors now, but I'm still getting undefined data!! even with get ok now working, thanks

Did you find this page helpful?