Skip to content
Source
Sign inSign up
TanStack/query

test(solid-query): cover useQueries in the SSR hydration test (#11185) #12696

Openkylemichaelreaves(GitHub profile, opens in a new tab)wants to merge 1 commit intosolid-query-v6-pre fromrefs/pull/12696/headopened View on GitHub

Showing 5 changed files with 43 additions and 0 deletions (loading 2).

x
0 of 5 viewed, 5 left
37 additions and 0 deletionspackages/solid-query/src/__tests__/fixtures/hydration/App.tsxModified
View file
@@ -11,6 +11,7 @@
QueryClientProvider,
noop,
useIsFetching,
+ useQueries,
useQuery,
} from '@tanstack/solid-query'
import type { QueryClient } from '@tanstack/solid-query'
@@ -22,6 +23,8 @@
stale: number
placeholder: number
prefetched: number
+ queriesFresh: number
+ queriesStale: number
​
export interface AppProps {
@@ -101,6 +104,39 @@
​
+/** The same staleness pair as above, read through `useQueries` (#11185):
+ * its rows must prime from the server payload like `useQuery` does. */
+function QueriesList(props: AppProps) {
+ const results = useQueries(() => ({
+ queries: [
+ {
+ queryKey: ['queries-fresh'],