Open
Description
Describe the bug
I am using the new mechanism to suspend explained here: https://tanstack.com/query/latest/docs/framework/react/guides/suspense#using-usequerypromise-and-reactuse-experimental
Disabled queries return a pending promise (which is ok), but the promise does not resolve when the query is enabled afterwards.
This happens because the query is not refetched when enabled changes from false to true.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/mystifying-mopsa-qwhjwx?workspaceId=ws_5WeinpZuX6zrSSrhdSgo5C
Steps to reproduce
Click the button to enable the query
Expected behavior
When the query is enabled it should fetch and the promise should finally resolve
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Chrome
- Version: 131.0.6778.205
Tanstack Query adapter
react-query
TanStack Query version
@tanstack/[email protected]
TypeScript version
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels