From 4fecbb222d5c8cbb3706b8ab57c854e7cec54819 Mon Sep 17 00:00:00 2001 From: Ezequiel Rodriguez Date: Sun, 25 Feb 2024 04:17:27 -0800 Subject: [PATCH] fix(query): usePrefetch should only work for Query/Infinite types (#1235) fixes #1234 --- packages/query/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/query/src/index.ts b/packages/query/src/index.ts index 4a44a1f05..4776cd1aa 100644 --- a/packages/query/src/index.ts +++ b/packages/query/src/index.ts @@ -1075,7 +1075,7 @@ ${doc}export const ${camel( return ${queryResultVarName}; }\n ${ - usePrefetch + usePrefetch && (type === QueryType.QUERY || type === QueryType.INFINITE) ? `${doc}export const ${camel( `prefetch-${name}`, )} = async >, TError = ${errorType}>(\n queryClient: QueryClient, ${queryProps} ${queryArguments}\n ): Promise => {