-
Notifications
You must be signed in to change notification settings - Fork 58
feat: Tanstack useQueries support #642
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
base: main
Are you sure you want to change the base?
feat: Tanstack useQueries support #642
Conversation
🦋 Changeset detectedLatest commit: 1482f80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This looks better, I'd like to retest it after we merge the incremental watch PR. |
|
Last bit of housekeeping @whygee-dev , could you add a changeset entry? Might also need to update with main. And then we can get this in! |
…liminate duplication between useQueries & useQuery
a87e6f6 to
25877a1
Compare
done |
|
Hey @whygee-dev ! Really sorry for the long delay on this, appreciate your patience. I've just pushed some updates (fixed imports and added explicit types + jsdoc examples). Would you mind giving it one last look when you get a chance? Thanks again for the contribution! |
LGTM ! Thank you |
|
Thanks for checking @whygee-dev,
|
|
So @whygee-dev it seems like there is something strange happening. |
Can you push somewhere the reproduction please ? I'll take a look ASAP |
Repo: https://github.com/Chriztiaan/tanstack-powersync-reproduction |
So after investigating, it seems like it the error is unset and soon after is set again. This seems expected behavior by tanstack query retry mechanism From: https://tanstack.com/query/latest/docs/framework/react/guides/query-retries
So what happens is when tanstack query retries, the error is unset during the loading. I can confirm this by disabling the retry const [customersList, customers] = useQueries({
queries: [
{ queryKey: ['lists'], query: 'SELECT * FROM lists' },
{ queryKey: ['todos'], query: 'sele', retry: false }
]
});The error is then never unset after it has been set |




This PR adds support for Tanstack's useQueries hook (see API and parallel queries).
This allows grouping of queries and combining results. The new
useQueriestest suite provides good examples of how this can be used.