Skip to content

feat: support skipToken in imperative queries - #12681

Draft
TkDodo wants to merge 5 commits into
query-v6from
tkdodo/feat/imperative-query-skip-token
Draft

TkDodo wants to merge 5 commits into
query-v6from
tkdodo/feat/imperative-query-skip-token

Conversation

@TkDodo

@TkDodo TkDodo commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

🎯 Changes

Stacked on #12679.

An explicit queryFn: skipToken makes queryClient.query() and queryClient.infiniteQuery() read the cache without starting or waiting for a fetch. The calls return existing data regardless of freshness and apply select when data exists. A cache miss resolves to undefined without creating an entry.

Calls whose options can contain skipToken return Promise<TData | undefined>. Calls whose options exclude the token keep Promise<TData>. Vue's reactive overloads follow the same rule.

Core and all seven adapter suites, type checks, and lint passed locally. Core and Vue package checks and docs link checks passed.

✅ 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.
  • This change is docs/CI/dev-only (no release).

@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e5f9b76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@tanstack/query-core Minor
@tanstack/vue-query Minor
@tanstack/angular-query Minor
@tanstack/lit-query Patch
@tanstack/preact-query Minor
@tanstack/query-async-storage-persister Minor
@tanstack/query-broadcast-client-experimental Minor
@tanstack/query-devtools Minor
@tanstack/query-persist-client-core Minor
@tanstack/react-query Minor
@tanstack/solid-query Minor
@tanstack/svelte-query Patch
@tanstack/vue-query-devtools Patch
@tanstack/angular-query-devtools Minor
@tanstack/angular-query-persist-client Minor
@tanstack/preact-query-devtools Minor
@tanstack/preact-query-persist-client Minor
@tanstack/react-query-devtools Minor
@tanstack/solid-query-devtools Minor
@tanstack/svelte-query-devtools Patch
@tanstack/react-query-persist-client Minor
@tanstack/solid-query-persist-client Minor
@tanstack/svelte-query-persist-client Patch
@tanstack/react-query-next-experimental Minor
@tanstack/eslint-plugin-query Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nx-cloud

nx-cloud Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit cd26c1e

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 7m 49s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-11-23 20:10:00 UTC

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

23 package(s) bumped directly, 2 bumped as dependents.

🟥 Major bumps

Package Version Reason
@tanstack/angular-query 5.108.3 → 6.0.0 Changeset
@tanstack/angular-query-devtools 5.108.3 → 6.0.0 Changeset
@tanstack/eslint-plugin-query 5.108.3 → 6.0.0 Changeset
@tanstack/lit-query 0.2.43 → 1.0.0 Changeset
@tanstack/preact-query 5.108.3 → 6.0.0 Changeset
@tanstack/preact-query-devtools 5.108.3 → 6.0.0 Changeset
@tanstack/preact-query-persist-client 5.108.3 → 6.0.0 Changeset
@tanstack/query-async-storage-persister 5.108.3 → 6.0.0 Changeset
@tanstack/query-broadcast-client-experimental 5.108.3 → 6.0.0 Changeset
@tanstack/query-core 5.108.3 → 6.0.0 Changeset
@tanstack/query-devtools 5.108.3 → 6.0.0 Changeset
@tanstack/query-persist-client-core 5.108.3 → 6.0.0 Changeset
@tanstack/react-query 5.108.3 → 6.0.0 Changeset
@tanstack/react-query-devtools 5.108.3 → 6.0.0 Changeset
@tanstack/react-query-next-experimental 5.108.3 → 6.0.0 Changeset
@tanstack/react-query-persist-client 5.108.3 → 6.0.0 Changeset
@tanstack/solid-query 5.108.3 → 6.0.0 Changeset
@tanstack/solid-query-devtools 5.108.3 → 6.0.0 Changeset
@tanstack/solid-query-persist-client 5.108.3 → 6.0.0 Changeset
@tanstack/svelte-query 6.4.6 → 7.0.0 Changeset
@tanstack/svelte-query-devtools 6.4.6 → 7.0.0 Changeset
@tanstack/vue-query 5.108.3 → 6.0.0 Changeset
@tanstack/vue-query-devtools 6.4.6 → 7.0.0 Changeset
@tanstack/angular-query-persist-client 5.108.3 → 6.0.0 Dependent
@tanstack/svelte-query-persist-client 6.4.6 → 7.0.0 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query

npm i https://pkg.pr.new/@tanstack/angular-query@12681

@tanstack/angular-query-devtools

npm i https://pkg.pr.new/@tanstack/angular-query-devtools@12681

@tanstack/angular-query-persist-client

npm i https://pkg.pr.new/@tanstack/angular-query-persist-client@12681

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@12681

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@12681

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@12681

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@12681

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@12681

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@12681

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@12681

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@12681

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@12681

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@12681

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@12681

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@12681

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@12681

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@12681

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@12681

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@12681

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@12681

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@12681

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@12681

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@12681

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@12681

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@12681

commit: cd26c1e

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.42 KB (+0.3% 🔺)
react minimal 8.2 KB (+0.23% 🔺)

Base automatically changed from tkdodo/feat/suspense-query-skip-token to query-v6 November 23, 2026 15:03
…ative-query-skip-token

# Conflicts:
#	.changeset/suspense-query-skip-token.md
#	docs/framework/react/guides/suspense.md
#	packages/preact-query/src/__tests__/useSuspenseQuery.test-d.tsx
#	packages/preact-query/src/__tests__/useSuspenseQuery.test.tsx
#	packages/preact-query/src/types.ts
#	packages/preact-query/src/useSuspenseQuery.ts
#	packages/react-query/src/__tests__/useSuspenseQuery.test.tsx
#	packages/react-query/src/types.ts
#	packages/react-query/src/useSuspenseQuery.ts

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.

1 participant