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

293 commits

Author SHA1 Message Date
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
우혁
428c19fa33
docs: update mutation status type (#9595)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:47:27 +09:00
우혁
2a8ba49919
docs: remove unnecessary trailing comma (#9594)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:44:30 +09:00
우혁
54efe225b6
docs: fix type definitions in useQuery options (union, parameters, extra parentheses) (#9596)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-30 14:36:19 +09:00
우혁
ad0ca9f37c
docs: fix missing comma in useMutation example to prevent syntax errors (#9593)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-30 14:28:48 +09:00
Kier Borromeo
1b0346fca8
docs: Updates examples for invalidation from mutations (#9261)
* Updates examples for invalidation from mutations

* ci: apply automated fixes

* Elaborate promise

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-19 12:23:41 +02:00
Dmytro Borysov
9a3f68373d
docs: Add not-prose class to browser logo images in devtools documentation (#9556) 2025-08-19 11:59:08 +02:00
Lee
2989e69dc0
docs(react-query): recommend defaultError = unknown instead of AxiosError (#9575)
* docs(react-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(react-query): clarify usage of defaultError in global Error type registration

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* ci: apply automated fixes

* docs(solid-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(angular-query): recommend defaultError = unknown instead of AxiosError

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* docs(vue-query): add example code for Registering a global Error

Signed-off-by: leesb971204 <leesb971204@gmail.com>

---------

Signed-off-by: leesb971204 <leesb971204@gmail.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-18 17:46:32 +02:00
TkDodo
f1e608bcac docs: update community resources 2025-08-18 12:19:08 +02:00
Dmytro Borysov
6402d756b7
chore: update browser icons (#9555) 2025-08-11 18:22:20 +02:00
Dmytro Borysov
d25c0da344
docs: Add Firefox and Edge browser extension support to devtools docs (#9548)
- Add browser logos for Chrome, Firefox, and Edge
- Update devtools documentation across all frameworks to include Firefox and Edge extensions
- Replace Chrome-only messaging with multi-browser support
- Add inline browser icons with links to respective extension stores
2025-08-11 13:08:47 +02:00
Lubos
fba477ba2b
Add oRPC to community projects for TanStack Query (React) (#9538)
* Add oRPC to community projects for TanStack Query (React)

* Update oRPC link to TanStack Query integration

This should make oRPC more relevant when people search for things like "orpc tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:52:50 +09:00
Lubos
0455d58bd7
Add Hey API to community projects for TanStack Query (React) (#9534)
* Add Hey API to community projects for TanStack Query (React)

* Update Hey API link to TanStack Query plugin

This should make Hey API more relevant when people search for things like "openapi tanstack query"

---------

Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-08-10 03:44:39 +09:00
Sajad Torkamani
c8322d96b1
docs: add missing period (#9509)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-07-31 20:35:25 +02:00
DavidPfl
76211bbd31
docs(react-query): change comma to sentence period (#9459)
Co-authored-by: David <pflaegingd@gmail.com>
2025-07-19 10:50:12 +02:00
Lachlan Collins
9133c101c8
chore: manually update dependencies (#9464)
* chore: update packages

* Fix typescript-eslint type mismatch

* Pin vitest

* Update prettier
2025-07-19 11:23:28 +10:00
Dominik Dorfmeister
23c8908086
feat(core): QueryObserver returns isEnabled flag (#9408)
* feat(core): QueryObserver returns isEnabled flag

* test: solid and svelte
2025-07-11 18:57:28 +02:00
우빈
f3cbfc51da
feat(react-query): add mutationOptions (#8960)
* feat(react-query): add mutationOptions

* test(react-query): add DataTag test case

* fix(react-query): remove unnecessary types from mutation

* fix(react-query): remove unncessary type overload

* chore(react-query): add mutationOptions to barrel file

* fix(react-query): fix test eslint issue

* docs(react-query): add more examples

* test(react-query): add more test cases

* chore(react-query): Change mutaitonKey to required

* fix(react-query): fix test code type error

* test(react-query): add testcase when used with other mutation util

* fix(react-query): fix error test code and avoid use deprecateed method

* fix(react-query): fix error test code and avoid use deprecateed method

* fix(react-query): fix import detect error

* fix(react-query): fix import detect error

* fix(react-query): add function overload

* test(react-query): fix mutation options test code

* Update docs/framework/react/typescript.md

* Update docs/framework/react/reference/mutationOptions.md

* Update docs/framework/react/typescript.md

* fix: update mutationOptions type definition to allow optional mutationKey with restricting filter when mutationKey wasn't passed

* ci: apply automated fixes

* chore: add Nick-Lucas as co-author

Co-authored-by: Nick Lucas <8896153+Nick-Lucas@users.noreply.github.com>

* test(react-query): fix test code and add used with useMutation without mutationKey

* Update packages/react-query/src/__tests__/mutationOptions.test-d.tsx

* docs: add mutationOptions to sidebar config

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nick Lucas <8896153+Nick-Lucas@users.noreply.github.com>
2025-07-09 16:59:41 +02:00
Dominik Dorfmeister
1078bce264
refactor: deprecate createSyncStoragePersister (#9316) 2025-06-27 15:52:38 +02:00