fix(vue-query): accept 'UseQueryOptions' in 'query', 'ensureQueryData', 'fetchQuery' and 'prefetchQuery' again by maximilian-hammerl · Pull Request #11644 · TanStack/query · GitHub
Skip to content

fix(vue-query): accept 'UseQueryOptions' in 'query', 'ensureQueryData', 'fetchQuery' and 'prefetchQuery' again - #11644

Open
maximilian-hammerl wants to merge 2 commits into
TanStack:mainfrom
maximilian-hammerl:main
Open

maximilian-hammerl wants to merge 2 commits into
TanStack:mainfrom
maximilian-hammerl:main

Conversation

@maximilian-hammerl

@maximilian-hammerl maximilian-hammerl commented Sep 25, 2026 •

Copy link
Copy Markdown

🎯 Changes

Fixes #11639. I added the necessary overloads, so that options that useQuery accepts are also accepted by ensureQueryData, fetchQuery and prefetchQuery, as in 5.102.8.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.

Summary by CodeRabbit

  • New Features
    • Vue Query client methods now accept reactive query options, including options with conditional query functions.
    • query, ensureQueryData, fetchQuery, and prefetchQuery retain their expected return types when using these options.

…e, ensureQueryData returns the cached type, and fetchQuery returns the cached type
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Comment on lines +358 to +371

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If were doing a cast here, that indicates to me that QueryExecuteOptions is where we should fix this not in just the vue adapter.

This branch has not been deployed

No deployments
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.

[vue-query] 5.103.0: UseQueryOptions is no longer assignable to ensureQueryData, fetchQuery and prefetchQuery

2 participants