diff --git a/packages/solid-query/src/__tests__/useQueries.test.tsx b/packages/solid-query/src/__tests__/useQueries.test.tsx
index 8392467a0b..4298d9e3da 100644
--- a/packages/solid-query/src/__tests__/useQueries.test.tsx
+++ b/packages/solid-query/src/__tests__/useQueries.test.tsx
@@ -11,7 +11,13 @@ import { fireEvent } from '@solidjs/testing-library'
import * as QueryCore from '@tanstack/query-core'
import { createRenderEffect, createSignal } from 'solid-js'
import { queryKey, sleep } from '@tanstack/query-test-utils'
-import { QueriesObserver, QueryCache, QueryClient, useQueries } from '..'
+import {
+ IsRestoringProvider,
+ QueriesObserver,
+ QueryCache,
+ QueryClient,
+ useQueries,
+} from '..'
import { renderWithClient } from './utils'
import type {
QueryFunction,
@@ -717,4 +723,59 @@ describe('useQueries', () => {
await vi.advanceTimersByTimeAsync(20)
QueriesObserverSpy.mockRestore()
})
+
+ it('should not fetch for the duration of the restoring period when isRestoring is true', async () => {
+ const key1 = queryKey()
+ const key2 = queryKey()
+ const queryFn1 = vi.fn(() => sleep(10).then(() => 'data1'))
+ const queryFn2 = vi.fn(() => sleep(10).then(() => 'data2'))
+
+ function Page() {
+ const results = useQueries(() => ({
+ queries: [
+ { queryKey: key1, queryFn: queryFn1 },
+ { queryKey: key2, queryFn: queryFn2 },
+ ],
+ }))
+
+ return (
+
+
{results[0].status}
+
{results[1].status}
+
{results[0].fetchStatus}
+
{results[1].fetchStatus}
+
{results[0].data ?? 'undefined'}
+
{results[1].data ?? 'undefined'}
+
+ )
+ }
+
+ const rendered = renderWithClient(queryClient, () => (
+ true}>
+
+
+ ))
+
+ await vi.advanceTimersByTimeAsync(0)
+
+ expect(rendered.getByTestId('status1')).toHaveTextContent('pending')
+ expect(rendered.getByTestId('status2')).toHaveTextContent('pending')
+ expect(rendered.getByTestId('fetchStatus1')).toHaveTextContent('idle')
+ expect(rendered.getByTestId('fetchStatus2')).toHaveTextContent('idle')
+ expect(rendered.getByTestId('data1')).toHaveTextContent('undefined')
+ expect(rendered.getByTestId('data2')).toHaveTextContent('undefined')
+ expect(queryFn1).toHaveBeenCalledTimes(0)
+ expect(queryFn2).toHaveBeenCalledTimes(0)
+
+ await vi.advanceTimersByTimeAsync(10)
+
+ expect(rendered.getByTestId('status1')).toHaveTextContent('pending')
+ expect(rendered.getByTestId('status2')).toHaveTextContent('pending')
+ expect(rendered.getByTestId('fetchStatus1')).toHaveTextContent('idle')
+ expect(rendered.getByTestId('fetchStatus2')).toHaveTextContent('idle')
+ expect(rendered.getByTestId('data1')).toHaveTextContent('undefined')
+ expect(rendered.getByTestId('data2')).toHaveTextContent('undefined')
+ expect(queryFn1).toHaveBeenCalledTimes(0)
+ expect(queryFn2).toHaveBeenCalledTimes(0)
+ })
})