query
query copied to clipboard
Solid: `refetchOnMount: false` causes suspenses when mutating
Describe the bug
this is a very weird bug that was a pain to debug due to that
i've been able to narrow it down to this:
- given a QueryClient with
refetchOnMount: false - and a
useQuerythat already has some data cached - the first mutation will cause a suspense to trigger
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-query-qltuvrie?file=src%2Findex.tsx
Steps to reproduce
- open repro
- open devtools
- click "mutate"
- notice how the dom tree below the suspense is re-added, and
Suspense triggeredis logged - click a few more times, notice how the suspense is not triggered
Expected behavior
Suspense is not triggered
How often does this bug happen?
Every time
Screenshots or Videos
https://github.com/user-attachments/assets/9098b06f-452b-4cbf-bab1-60d8515f2126
Platform
- OS: macOS
- Browser: Chrome 142
- Version: solid-query 5.90.13, solid 1.9.10
Tanstack Query adapter
solid-query
TanStack Query version
5.90.13
TypeScript version
5.8.3
Additional context
No response