Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useTransactionQuery never fetches #2187

Open
cdomigan opened this issue Feb 28, 2025 · 2 comments · May be fixed by #2188
Open

useTransactionQuery never fetches #2187

cdomigan opened this issue Feb 28, 2025 · 2 comments · May be fixed by #2188

Comments

@cdomigan
Copy link

cdomigan commented Feb 28, 2025

Very excited by this library - thank you!

I was trying to debug my useTransactionQuery() never making a fetch request, regardless of cache settings. On inspection, turns out it wraps useQuery with a prepare and all refetch options set to false. So I tested useQuery with these options, and it never fetches either.

Please see sandbox for example:
https://codesandbox.io/p/sandbox/d4tw43

(I've replaced fetcher with a console.log("..."), which never fires.)

I should expect both examples to do an initial fetch, right?

@vicary
Copy link
Member

vicary commented Mar 1, 2025

Yes, in hindsight it is relying on the suspense option. A $refetch() should be invoked on the first render with skip and suspense disabled. I'll make a PR soon and you may test again with the canary version there.

@cdomigan
Copy link
Author

cdomigan commented Mar 1, 2025

Thank you @vicary 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants