Skip to content
Source
Sign inSign up
TanStack/query

feat: support skipToken in useSuspenseQuery #12679

MergedTkDodomerged 6 commits intoquery-v6 fromrefs/pull/12679/headmerged by TkDodo View on GitHub

TkDodocommented

🎯 Changes

Allow useSuspenseQuery in React and Preact to accept skipToken, including through queryOptions. A skipped query reads the cache without suspending or starting a fetch. Calls with a query function keep TData. Calls that can skip return TData | undefined. TypeScript utilities such as ReturnType see the wider overload.

Both adapter test suites, type checks, lint, builds, package checks, and docs link checks passed locally.

✅ 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).
    1. Pushed4575cb2

    2. Pusheda076552

    3. Pushedc9d4c57

    4. Pushed9ec9bc6

    5. Pushed201f484

    6. TkDodo merged thisaee43cb

    7. TkDodo closed this

Sign in to join this conversation.