-
Notifications
You must be signed in to change notification settings - Fork 49
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
|
…liminate duplication between useQueries & useQuery
This looks better, I'd like to retest it after we merge the incremental watch PR. |
expect(result.current).toContain('SELECT 1'); | ||
expect(result.current).toContain(1); | ||
expect(result.current).toContain('SELECT 2'); | ||
expect(result.current).toContain(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been looking at the docs here: https://tanstack.com/query/latest/docs/framework/react/reference/useQueries#combine
Based on that I don't really understand why we expect/want the query or parameters to be in the result at all. I would suggest also mocking a result in here so that we can see how combine works with actual data.
await waitFor(() => { | ||
const results = result.current as any[]; | ||
expect(results[0].data[0].test).toEqual('custom'); | ||
expect(results[1].data[0]).toEqual('SELECT 2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for Tanstack's useQueries hook (see API and parallel queries).
This allows grouping of queries and combining results. The new
useQueries
test suite provides good examples of how this can be used.