T
TanStack3y ago
fair-rose

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.
peaceful-chebyshev-g1k6rq
CodeSandbox is an online editor tailored for web applications.
1 Reply
generous-apricot
generous-apricot3y ago
Hi @esc4rg0t , please see this: https://github.com/TanStack/query/issues/5351
GitHub
Svelte - Update not triggering after mutation and `invalidateQuerie...
Describe the bug When stripping down the example in the CodeSandbox (especially removing the '...isFetching'), updates to objects are not triggering correctly. At least elements depending o...

Did you find this page helpful?