orval icon indicating copy to clipboard operation
orval copied to clipboard

fix(query): usePrefetch should only work for Query/Infinite types

Open ezequiel opened this issue 1 year ago • 1 comments

Status

READY

Description

Make sure we only generate prefetch calls for QUERY and INFINITE types, as it isn't possible to prefetch any other types.

Fixes #1234

Steps to Test or Reproduce

export default defineConfig({
  client: {
    input: '...',
    output: {
      client: 'react-query',
      override: {
        query: {
          usePrefetch: true,
          useQuery: true,
          useSuspenseQuery: true,
        },
      },
      ...output,
    },
  },
});

Verified strictly await queryClient.prefetchQuery(queryOptions) calls were generated

ezequiel avatar Feb 25 '24 08:02 ezequiel