0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

261 commits

Author SHA1 Message Date
max
79d2384db5
docs(*): fix 'homogenous', 'stoage', 'supressed', 'compoennts' spelling typos (#11040)
* fix: correct spelling typos across docs, examples, and source comments

- homogenous -> homogeneous in 7 useQueries/createQueries source files
- stoage -> storage in react and vue createPersister docs
- supressed -> suppressed in react and angular pagination examples
- compoennts -> components in solid-start-streaming example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(react-query/useSuspenseQueries): correct 'homogenous' typo to 'homogeneous' in comment

---------

Co-authored-by: maxtaran2010 <ocotifuzo727@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-13 14:06:03 +09:00
Samuel Wai Weng Yong
f6cf12002a
docs({react,solid}-query): add missing 'errorUpdateCount' to 'useQuery' return signature (#11041)
* docs(react-query): add missing errorUpdateCount to useQuery return signature

* docs(react-query): move errorUpdateCount after errorUpdatedAt

* docs(react-query): keep 'errorUpdateCount' before 'errorUpdatedAt' to preserve alphabetical order

---------

Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
2026-07-13 03:28:00 +09:00
Dmytro Borysov
ad57c81fd3
docs(devtools): make markdown consistent (#10987)
Currently there is a bug, which prevents proper rendering of the links if there are both MD & HTML syntax in the same line (see https://tanstack.com/query/latest/docs/framework/react/devtools), probably should be fixed in @tanstack/markdown. Not sure that the source code of this package is published?

In the meantime, I just converted all links to html.

Converting everything (logos) to markdown won't work because we need to set width/height, which can't be done in markdown
2026-06-27 21:50:32 +02:00
Bartek Iwańczuk
b03390bfc8
docs: add Deno to installation instructions (#10971)
docs: add Deno to install instructions
2026-06-27 17:05:59 +02:00
Jonghyeon Ko
1f84256a2e
docs: document the select typing caveat for parallel-queries hooks (#10984)
Inlining a `select` on a query object passed to `useQueries` /
`useSuspenseQueries` can't infer its `data` argument from the sibling
`queryFn` and falls back to `unknown` — a known TypeScript limitation
(TanStack/query#6556).

Document the two workarounds (annotate the `select` parameter, or define
the query with the `queryOptions` helper) in the React docs, and add type
tests guarding the behavior. Scoped to React for an easier review; the
other framework adapters can follow the same pattern in separate PRs.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:30:15 +02:00
Jakub Šimko
47e539a9f4
docs(react-query): recommend against using server actions in queryFn (#10927) 2026-06-14 13:04:16 +02:00
Wonsuk Choi
dc0effd033
docs(framework/react/guides): replace deprecated 'isServer' with 'environmentManager.isServer()' (#10866) 2026-06-03 22:23:14 +09:00
Cam Jackson
b125ba9c5c
docs(react-query): undefined vs. null in query-functions.md (#10008)
* docs(react-query): undefined vs. null in query-functions.md

* Apply suggestion from @TkDodo

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2026-05-22 18:37:05 +02:00
Stephen Gibler
ae054a0e9a
docs: update Next.js TypeScript docs reference (#10753)
Co-authored-by: Stephen Gibler <261876204+sgibler-droid@users.noreply.github.com>
2026-05-22 16:18:07 +02:00
Wonsuk Choi
bf2546feb0
docs(devtools): add missing 'theme' option (#10621) 2026-05-02 10:50:20 +09:00
Wonsuk Choi
868577d5da
docs(devtools): align logo, panel, and option union descriptions across docs and JSDoc (#10617)
* docs(devtools): replace framework-specific logo with 'TanStack logo' to match the actual rendered component

* docs(vue-query/devtools): replace 'React Query' panel leftover with 'Vue Query'

* docs(devtools): replace framework-specific logo with 'TanStack logo' and use adapter naming for 'devtools panel' in JSDoc

* docs(devtools): add missing 'relative' to JSDoc 'buttonPosition' union

* chore(.changeset): add changeset for devtools logo, panel, and 'buttonPosition' union alignment

* docs(preact-query-devtools): add missing 'position' union to JSDoc
2026-05-01 16:34:40 +09:00
Dami Oyeniyi
3d1a62e63b
fix(devtools): change onClose callback type from () => unknown to () … (#10118)
* fix(devtools): change onClose callback type from () => unknown to () => void

* Fix onClose callback type in devtools

Updated onClose callback type in devtools to improve type safety.

* chore(changeset): fixed truncated changeset description

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2026-04-25 17:40:17 +02:00
Dominik Dorfmeister 🔮
6540a4126b
feat(core): callback for retryOnMount (#10515)
* feat(core): callback for retryOnMount

* ci: apply automated fixes

* fix: vue

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-23 14:45:49 +02:00
sourena kazemi
63909c76e3
docs(react): small grammar fix in advanced-ssr docs (#10507) 2026-04-16 20:53:27 +09:00
Zelys
67b12ae1a0
docs: add polling guide (#10330)
* docs(react): add polling guide

Adds a dedicated guide for refetchInterval-based polling. The option was
only mentioned in passing in important-defaults.md with no explanation of
how it works, how to adapt it dynamically, or how it interacts with window
focus, networkMode, and the enabled flag.

Covers:
- Basic setup and independence from staleTime
- Dynamic intervals via function form
- refetchIntervalInBackground for dashboards / always-on UIs
- Disabling window-focus refetching for fullscreen game and kiosk UIs
- Pausing polling with the enabled flag
- networkMode: 'always' for unreliable navigator.onLine environments
- Deduplication behavior across multiple observers

Updates config.json to add the guide to the React sidebar between
Window Focus Refetching and Disabling/Pausing Queries.
Adds a cross-reference in important-defaults.md.

* docs(react/polling): add example markers for framework portability

* docs(react): fix deduplication note — timers are per observer, not per query

* docs(react): address review feedback on polling guide

- Remove staleTime enumeration; link to Important Defaults instead
- Remove game/kiosk focus management examples (scope creep)
- Rewrite pausing polling to use refetchInterval function instead of enabled: false
- Fix offline support section: connectivity uses online/offline events, not navigator.onLine
- Fix deduplication note: remove queuing implication and em dash
- Add non-browser environments note pointing to React Native guide

* docs(solid,vue): add polling guide framework ports

* docs: wrap React Native section in markers for framework port exclusion

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-01 11:04:45 +02:00
Zelys
3fd34606eb
docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers (#10354)
* docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers

* docs(react): lead with invalidateQueries() distinction for staleTime: 'static' vs Infinity
2026-03-31 16:11:02 +02:00
Pavan Shinde
5cd3896947
docs(react): update legacy react-query GitHub links (#10232)
* docs(react): update legacy react-query GitHub links

* docs: fix React Query stars badge repo
2026-03-18 12:49:21 +01:00
Dominik Dorfmeister 🔮
67cf8b60d9
ref: ts cutoff (#10253)
* ref: update typescript versions

* check for tsgo

* drop 5.2 and 5.3

* docs

* ref: fix tsup config

* ref: use built-in NoInfer

* ci: apply automated fixes

* fix tsup config

* Revert "ref: use built-in NoInfer"

This reverts commit 45d428ce71.

# Conflicts:
#	packages/preact-query/src/useQuery.ts

* ref: remove tsgo for now

* fix builds

* fix: update svelte-check

* fix: svelte-check still needs ts 5.9

* fix: knip + ts rewrite

* ci: apply automated fixes

* fix: make ts 5.9 the tscurrent version

* fix custom conditions

* fix: coderabbit comments

* fix: lockfile

* revert docs

* fix: override eslint to 8.56.1

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-03-09 08:12:35 +01:00
Pavan Shinde
fe25edc2f9
docs(react): fix broken anchors in SSR and migration guides (#10214)
* docs(react): fix broken anchors in SSR and migration guides

* Update docs/framework/react/guides/ssr.md

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-03-04 13:46:58 +01:00
Roitium.
3f30619e7f
docs(react-native): fix example to include initial state (#10172)
* docs: fix expo-network example code block

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-26 15:14:24 +01:00
Wonsuk Choi
e31bda9136
docs(solid-query): convert guide docs to ref-based with Solid-style code (#10146)
* docs(react-query/guides): add markers for solid-query guide overrides

* docs(solid-query/guides): convert guide docs to ref-based with Solid-style code

* docs(config): add solid offline example entry and update lockfile

* ci: apply automated fixes

* docs(react/guides/caching): unify staleTime wording to passive voice

* chore(pnpm-lock.yaml): fix broken lockfile for 'msw' dependency

* docs(solid/guides/caching): remove redundant 'StaleNote' override now unified with react

* docs(react/guides/caching): remove unused 'StaleNote' markers

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-26 14:27:51 +01:00
René Klomp
978fc52728
feat(experimental_createQueryPersister): Add removeQueries (#10186)
* Add removeQueries

* Docs

* ci: apply automated fixes

* Fix test

* Add changeset

* Udpate docs

* Await removeItem

* Improve test names

* Update .changeset/fifty-zebras-stay.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Add coderabbitai suggestion

* More data integrity checks

* removeItem if deserialize fails

* removeItem if deserialize fails in retrieveQuery as well

* removeItem if deserialize fails in restoreQueries

* Revert changes outside removeQueries scope

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-02-26 12:44:41 +01:00
vedanta
ce94b37d6a
preact-docs problems fixed (#10160)
Things like Preact-Native, Preact 18.0+ is a remnant of using react-docs but without section-wise splitting. This handles that.
2026-02-21 19:37:16 -06:00
Pavan Shinde
a25e99d6cb
docs: fix TanStack capitalization (#10128) 2026-02-13 12:07:24 +01:00
Pavan Shinde
4ab43b3c0e
docs: fix grammar in SSR serialization section (#10086) 2026-02-11 09:31:28 +01:00
vedanta
8f0d834382
feat: Preact Adapter (#9935)
* initial setup -- duplicated + package.json edited

* simple preact updations

* missed a React.ReactNode

* testing grunt work (preact library + other small issues + ErrorBoundary custom implementation)

* missed a few

* Adds ErrorBoundary (from react-error-boundary, but scaled down for preact) -- fixes a lot of tests, which expect react-related functionality

* useSuspenseQueries left -- removed the useQuery.promise tests

* forgot the console logs

* useSuspenseQueries 2 resolved; tests done

* ci: apply automated fixes

* fix: example

* fix: configs should be symlinks

* fix: sync versions for npm-run-all2

* ref: re-sync runall2

* ref: go back to 5.0.0

* ref: remove changelog

* react-query -> preact-query

* remove use client directive + added the useSyncExternalStore (decoupled from compat)

* remove the react remnants

* generate docs

* typescript eslint

* docs

* vite config fix

* docs now reference react docs (most of them atleast)

* code-rabbit issues addressed

* <div/> lol

* fix: docs

* ci: apply automated fixes

* fix: lockfile

* fix: duplicated versions

* lockfile (I cooked or am I cooked)

* ci: apply automated fixes

* Making small edits to fix versioning, warnings, and lock

* unhandled error compat

* Fixing CI

* Fixed the CI errors

* ci: apply automated fixes

* Prettier format

* Update changeset for Preact Adapter feature

---------

Co-authored-by: TkDodo <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-10 12:02:20 +01:00
Daniel Bondarenko
4e8be3f46f
docs: clarify that failureCount starts at 0 in retry callback (#10031)
Added clarification that failureCount parameter in the retry callback
function starts at 0 for the first retry attempt, not 1.

Fixes #10017
2026-01-16 11:24:55 +01:00
dilmuhammad abdumalikov
31e3db527a
Enhance scroll restoration documentation for TanStack Query (#9987)
* Enhance scroll restoration documentation for TanStack Query

Explain how TanStack Query improves scroll restoration in SPAs by caching data and preventing UI resets.

* Update docs/framework/react/guides/scroll-restoration.md

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-12-28 11:29:15 +01:00
Tanner Linsley
f64ac77e83
Update bundlephobia link to TanStack React Query (#9990)
docs: update bundlephobia links to @tanstack/react-query

The bundlephobia links were pointing to the old react-query package (v3)
instead of the current @tanstack/react-query package.

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-27 13:01:45 +01:00
Talgat Minigaliev
bdec357b9e
docs: Modify onMutate signature to add context parameter (#9982)
Updated the onMutate function signature to include context.
2025-12-27 12:31:21 +01:00
Ofek Lavie
8471715987
docs: Document possible conflict between PersistQueryClientProvider and SSR streaming (#9979)
* Add docs about PersistQueryClientProvider settings

* correct

* Apply suggestion from @TkDodo

* Apply suggestions from code review

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-12-26 20:36:05 +01:00
Bailey Lissington
ecf9696c08
docs: correct grammar (#9953) 2025-12-26 20:33:39 +01:00
Elias Witt
23f636c674
docs: fix small grammar mistake (#9992) 2025-12-26 20:33:14 +01:00
Shumyla Farid
ee16773c70
docs: clarify cache time in caching guide for useQuery (#9967)
Clarify cache time in caching guide for useQuery
2025-12-21 15:01:52 +01:00
BrysonXiao
84d98445c4
docs: Update prefetching.md to fix typo (#9984)
A "be" was missing in the paragraph.
2025-12-21 14:35:13 +01:00
Lachlan Collins
5ad78fc4ad
docs: correct local relative links (#9947)
* docs: correct local relative links

* Update links

* Slight tweaks

* String
2025-12-05 22:39:25 +11:00
AhmadKamal049
2eb772cbd5
docs: Rename Todo component to BlogPost (#9853) 2025-11-08 17:50:06 +01:00
Sarah
7783a7ae49
docs: add community resources page (#9831)
* add community resources page

* update link for blog posts

* update community resource links

* rm vue community section

* update old links

* fix community resource link
2025-11-06 12:59:56 +01:00
daninus14
40b296b43f
docs: Update query function to include page parameter (#9792)
the first example was broken, now it works!
2025-11-01 21:55:21 +01:00
Varun
411f030eb9
docs: improve skipToken refetch incompatibility warning (#9816)
docs: improve skipToken and refetch incompatibility warning

- Add detailed explanation of Missing queryFn error when using refetch() with skipToken
- Provide clear guidance to use enabled: false instead for manual refetching
- Systematic fix affects all frameworks (Vue, Angular, Solid) via inheritance

Fixes #7599
2025-11-01 19:32:11 +01:00
DongHyeonWon
14a032d820
docs(react-query): add react background retry pausing documentation for v5 (#9755)
* docs: add react background retry pausing documentation for v5

* docs: add background retry behavior to query-retries guide
2025-11-01 19:13:33 +01:00
Greg Schechter
38b40081ce
docs: Fix typo in Connect section of community-projects.md (#9777)
Fix typo in Connect section of community-projects.md
2025-10-24 20:00:07 -07:00
Damian Osipiuk
5cd86c6ef1
fix(query-persist-client-core): add option to change behavior of refetch after restore (#9745) 2025-10-10 23:04:23 +02:00
Lachlan Collins
89be1895e3
chore: update svelte examples and tests from runes PR 2025-09-26 22:51:17 +10:00
Cam Jackson
cd290631ab
docs(react-query): add caveat for typing getQueriesData (#9684) 2025-09-24 14:41:36 +02:00
Josh
a2151d28e1
feat(query-core): add context to mutationfn & mutation callbacks (#9615)
* feat(query-core): add context to mutationfn

Co-Authored-By: travikk <627275+travikk@users.noreply.github.com>

* fix(query-core): mutation onSuccess scope param should also be undefined

Co-Authored-By: travikk <627275+travikk@users.noreply.github.com>

* feat: add scope deprecate context on mutation state

* feat(query-core): add mutation context to all mutation callbacks

* chore: pr amends

Co-Authored-By: Dominik Dorfmeister <1021430+TkDodo@users.noreply.github.com>

* test(unit): update to handle context in mutation callbacks

* chore: rename to onMutateResult

* chore: revert context deprecation on MutationState

---------

Co-authored-by: travikk <627275+travikk@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <1021430+TkDodo@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-09-16 10:22:43 +02:00
Zakaria Abu Sarah ザカリヤ
f49cc75e4a
docs: Remove fragment in disabling-queries guide (#9619)
Fragment is not needed here
2025-09-05 16:48:13 +02:00
Jake Teton-Landis
a0b96db937
feat(query-core): add timeoutManager to allow changing setTimeout/setInterval (#9612)
* add timeoutManager class

* add additional types & export functions

* convert all setTimeout/setInterval to managed versions

* tweaks

* add claude-generated tests

* tests

* revert changes in query-async-storage-persister: no path to import query-core

* re-export more types

* console.warn -> non-production console.error

* query-async-storage-persister: use query-core managedSetTimeout

* pdate pnpm-lock for new dependency edge

* sleep: always managedSetTimeout

* remove managed* functions, call method directly

* remove runtime coercion and accept unsafe any within TimeoutManager class

* cleanup; fix test after changes

* name is __TEST_ONLY__

* notifyManager: default scheduler === systemSetTimeoutZero

* Improve TimeoutCallback comment since ai was confused

* remove unnecessary timeoutManager-related exports

* prettier-ify index.ts (seems my editor messed with it already this pr?)

* continue to export defaultTimeoutProvider for tests

* oops missing import

* fix: export systemSetTimeoutZero from core

* ref: use notifyManager.schedule in createPersister

because it needs to work with whatever scheduleFn we have set there

* ref: move provider check behind env check

* docs

* doc tweaks

* doc tweaks

* docs: reference timeoutManager in discussion of 24 day setTimout limit

* Apply suggestion from @TkDodo

* Apply suggestion from @TkDodo

* chore: fix broken links

* docs: syntax fix

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-09-05 13:37:09 +02:00
Vlad Kovechenkov
f97d7258a0
docs: mention second parameter for cancelQueries (#9597)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-09-02 12:08:19 +09:00
Imad Selka
0650eaf116
docs: clarify queryClient refetch behavior for stale queries (#9560)
* docs(queryClient): add example for refetchQueries with stale: true and type: active

* docs(react-native): modify useRefreshOnFocus example

* docs(react-native): add queryKey in useRefreshOnFocus example

* Apply suggestion from @TkDodo

* ci: apply automated fixes

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-01 12:53:17 +02:00