Skip to content

Commit

Permalink
fix(query): usePrefetch should only work for Query/Infinite types (#1235
Browse files Browse the repository at this point in the history
)

fixes #1234
  • Loading branch information
ezequiel authored Feb 25, 2024
1 parent 15e9033 commit 4fecbb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\n queryClient: QueryClient, ${queryProps} ${queryArguments}\n ): Promise<QueryClient> => {
Expand Down

0 comments on commit 4fecbb2

Please sign in to comment.