TanStackT
TanStack3y ago
1 reply
primary-violet

Mutation not triggering updates properly

I have just started switching an application to using svelte-query. So far most of the mutations seem to work properly, with one exception: updates.
I retrieve a list of objects via createQuery. I use that store to feed a table ($objects.data).
When I modify a single instance of these objects with a mutation and call invalidateQueries(<queryKey>) no re-rendering is triggered on my table. To simplify things, I modified the playground sample and kicked out a lot of things like xxx.isFetching which triggers a re-render and finally got to a state where editing a todo on the list will not trigger a re-render:
https://codesandbox.io/p/sandbox/peaceful-chebyshev-g1k6rq?file=%2Fsrc%2Froutes%2FEditTodo.svelte&selection=%5B%7B%22endColumn%22%3A9%2C%22endLineNumber%22%3A85%2C%22startColumn%22%3A9%2C%22startLineNumber%22%3A85%7D%5D

Not sure if I am doing something completely wrong or if there is a bug somewhere, but if editing a todo from the list, the list on top with the edit buttons does not update. But the directly rendered store below (which is the mock storage/api actually) does.
CodeSandbox is an online editor tailored for web applications.
peaceful-chebyshev-g1k6rq
Was this page helpful?