Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

ezequiel
Copy link
Contributor

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

Verified

This commit was signed with the committer’s verified signature.
mayeut Matthieu Darbois
@ezequiel ezequiel marked this pull request as ready for review February 25, 2024 08:48
@melloware melloware added this to the 6.26.0 milestone Feb 25, 2024
@melloware melloware merged commit 4fecbb2 into orval-labs:master Feb 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usePrefetch+useSuspenseQuery incorrectly generates prefetchSuspenseQuery calls
2 participants