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
Dominik Dorfmeister
f052bf2642
fix(docs): Update persistQueryClient.md 2025-06-27 11:09:37 +02:00
Dmytro Borysov
1a0ab99943
docs: add Chrome extension information for TanStack Query devtools across multiple frameworks (#9275) 2025-06-19 20:51:01 +02:00
Ali Helmi
22368e03cf
docs: clarify comment regarding userIds in dependent queries example (#9288)
* docs: clarify comment in dependent queries example for userIds

* docs: clarify comment regarding userIds in dependent queries example
2025-06-19 11:40:42 +02:00
Jonghyeon Ko
cdab6e2b2b
ci: add link verification step to PR workflow (#9267) 2025-06-19 01:28:16 +09:00
Collin Stevens
cba46b5d79
docs: fix relative links (#9262)
* fix relative links

* Update mutations.md
2025-06-09 09:11:45 +02:00
H. C. Kruse
10b4c2fbe5
docs: Remove superfluous text from mutations.md (#9256)
Sentence ends in `Add commentMore actions` looking out of place.
2025-06-06 15:37:37 +02:00
Christina Martinez
eae7bde328
docs: Replace accidentally-deleted content in mutations.md (#9254)
Co-authored-by: christinamartinez <christina.martinez@faithlife.com>
2025-06-06 09:14:14 +02:00
Braden Wong
dfbda9de66
refactor(types): revert narrow onSuccess/onError/onMutate/onSettled callback types to Promise<void> | void (#9202)" (#9251)
This reverts commit 982f6ca607.
2025-06-05 15:04:37 +02:00
René Klomp
9e0e60c7f0
fix(experimental_createQueryPersister): Change persisterRestoreAll to restoreQueries with filter support (#9230)
* Add persisterRestoreByKey

* Fix imports

* Add missing return statement

* Fix test

* docs

* Add extra test

* Merge into single restoreQueries function
2025-06-04 20:37:26 +02:00
clonemycode
a2a23a89a3
chore: remove redundant word in comment (#9231)
Signed-off-by: clonemycode <clonecode@aliyun.com>
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2025-06-03 02:32:03 +09:00
Zentrik
ff2b51a7da
docs: Mention query keys needs to be serializable using JSON.stringify (#9204)
This was not clear to me and so maybe a useful addition to the docs
2025-06-02 18:11:06 +02:00
Braden Wong
982f6ca607
refactor(types): narrow onSuccess/onError/onMutate/onSettled callback types to Promise<void> | void (#9202)
* refactor: narrow onSuccess/onError/onMutate/onSettled callback types to Promise<void> | void

Previously, the `onSuccess`, `onError`, `onMutate`, and `onSettled` callbacks were typed as `() => Promise<unknown> | unknown`. While `unknown` is technically valid, it implies that the return value might be used, assigned, or further processed. However, throughout the codebase, these callbacks are invoked solely for their side effects, and their return values are always ignored. Narrowing the type to `Promise<void> | void` makes this intent explicit, clarifies that any return value will be discarded, and prevents misleading type signatures that suggest otherwise.

This commit narrows their types to `() => Promise<void> | void`, which more accurately reflects their intended use.

* docs: update callback return types to Promise<void> | void in mutation-related documentation

This commit refines the documentation for mutation-related callbacks (`onSuccess`, `onError`, `onSettled`, and `onMutate`), changing their return types from `Promise<unknown> | unknown` to `Promise<void> | void`.
2025-06-02 18:09:24 +02:00
Dominik Dorfmeister
b475d21568
feat(core): staleTime: 'static' (#9139)
* feat(core): StaleTime.Static

* fix: consider StaleTime.Static for invalidation

previously, it didn't matter if we included `stale: true` or not in the filters for refetch, because marking things with query.invalidate() would set them all to stale anyway.

Now, queries with StaleTime.Static will be marked as `invalidated`, but still shouldn't be refetched. The `isStale` filter logic accounts for that, so we have to include it in the filters

* fix: isStale order check

check for observers first because they contain the source of truth calculated with `isStaleByTime`, and it also takes enabled into account

* fix: isStaleByTime logic

we have to check for undefined data first, because queries without data are really always stale; then, the next check must be against StaleTime.Static, because queries that are marked as invalidated are still not stale, even if they are static.

* tests

* fix: type issue in react

* fix: make sure invalidation _always_ only refetches stale queries

this ensures we never refetch Static queries

* fix: never refetch static queries

* fix: make sure we don't refetchOn... for StaleTime.Static even when 'always' is set

* docs: StaleTime.Static

* ref: switch to 'static' string

* docs
2025-05-29 11:40:52 +02:00
Rodrigo Monney
f2b6cafe23
docs: Update overview.md (#9181)
Standardize the bullet point sentences to not have a period at the end (some have it, others don't)
2025-05-24 10:04:02 +02:00
autofix-ci[bot]
20c36c8bf3
ci: apply automated fixes 2025-05-24 06:48:59 +00:00
Tanner Linsley
afc6302dbf docs: fix links
commit 113eb6ba963534fe80b3e96193d767bf769c8bff
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:16:11 2025 -0600

    docs: fix: only transform generated reference

commit d1d084ed9026e31ba746e1bb87d5c19183a7d148
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 23:12:07 2025 -0600

    docs: fix broken links

commit 0df59ea7d8afb16be86ae917fc46900b6e999351
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:54:19 2025 -0600

    fix: rewrite type doc links to be directory-relative

commit 81e4c71f1c9250005f164b7e585837ee0ad14e23
Author: Tanner Linsley <tannerlinsley@gmail.com>
Date:   Fri May 23 15:14:51 2025 -0600

    fix: initial fix for ./ => ../
2025-05-24 00:47:55 -06:00
László Bucsai
09a55bf297
docs: update infinite query fetchNextPage examples (#9172) 2025-05-22 17:32:31 +02:00
shagag
c1142b923b
docs(react-query): Small rephrase of adavnced-ssr.md (#9152)
“Let’s next look” – This is slightly awkward
2025-05-15 21:03:06 +02:00
Damian Osipiuk
65ef198ad8
fix(experimental_createQueryPersister): return more utilities, rename persister (#8062)
* fix(experimental_createQueryPersister): return more utilities, rename persister

* chore: some docs

* test: add tests for utilities

* ci: apply automated fixes

* fix: add missing await

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-13 23:39:40 +02:00
Austin Johnson
696fd443c7
feat(devtools): 🏝️ TanStack Query DevTools for Expo/React Native! 🚀 (#8846)
* test

* feat(devtools): add action event types and notify functionality for query actions

* cleanup commeny

* fix(devtools): update notifyDevtools to use queryClient for all action notifications

* remove dup call

* Fix online manager bug not syncing correctly

* Update docs

* Fix default case error due to additional events from dev tools.

* Add events

* ci: apply automated fixes

* Remove no longer needed code

* ci: apply automated fixes

* revert previous change

* undo minor text change

* ci: apply automated fixes

* Update packages/query-devtools/src/Devtools.tsx

* Apply suggestions from code review

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-12 11:00:57 +02:00
Dovakeidy
cb40661209
docs(comparison): mark RTK Query as supporting infinite queries (#9120)
RTK Query now supports infinite queries as introduced in Redux Toolkit v2.6.0. This feature allows efficient pagination handling through useInfiniteQuery, with built-in support for fetching next/previous pages and managing paginated cache state.

Docs: https://redux-toolkit.js.org/rtk-query/usage/infinite-queries
Release: https://github.com/reduxjs/redux-toolkit/releases/tag/v2.6.0
2025-05-09 12:20:50 +02:00
Dominik Dorfmeister
10493efa8a
refactor(core): switch from Object.defineProperty to Proxies (#9079)
* ref: switch from Object.defineProperty to Proxies

* test: improve the test that tracks property access
2025-04-29 12:48:29 +02:00
Zac Rosenbauer
eb15f8727c
docs: fix broken links in docs (#9052) 2025-04-25 14:36:10 +02:00
Giorgio Polvara
376bbd25a3
docs: fix documentation on status for suspense hooks (#9008)
* fix documentation on status for suspense hooks

* Fix formatting in useSuspenseInfiniteQuery.md
2025-04-12 22:05:20 +02:00
David Madner
2e1282ca03
fix(persistQueryClientRestore): better error handling for persistQueryClientRestore (#8969)
* fix(persistQueryClientRestore): Do not swallow exceptions during in persistQueryClientRestore within `restoreClient` and `removeClient`

* fix: rethrow errors in removeClient within all branches

* fix: test for PersistQueryClientProvider in all consumers

* chore: implement PR feedback

* chore: mock console calls, so they do not end up in the console. This way we can also assert on the invocations

* chore: consoleWarn mocks to be restored after each test

* chore: remove tmp file commited accidentally

* chore: adjust docs and include new optional callback `onError`

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-04-10 18:13:17 +02:00
Juan Gonzalez
47e6662dd3
docs: fix a few typos (#8962) 2025-04-10 14:15:03 +02:00
spookyuser
b18972fab5
docs: update createPersister.md with info about cache mutations (#8893)
* Update createPersister.md with info about https://github.com/TanStack/query/issues/6310

* Fix typo

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-10 14:02:45 +02:00
Mohammad Reza Badri
0e1d866dfe
docs: correct missing closing quote in networkMode option (#8965) 2025-04-07 14:21:06 +02:00
MINSEONG KIM
7cb634b6b3
docs: typo (#8932) 2025-04-02 08:46:03 +02:00
Sebastián Ramírez
bab91651fb
docs: ✏️ Fix typo in docs/framework/react/overview.md, "React Query" to "TanStack Query" (#8934) 2025-04-02 08:45:29 +02:00
novice0840
d3cf47968e
docs(react-guides): fixed link typo (#8923) 2025-04-01 15:50:19 +02:00
Clarence
24c80558c4
docs(react-reference): fixed cancellation typo (#8883) 2025-03-31 11:10:17 +02:00
Clarence
f1743868b2
docs(react-guides): fixed cancellation typo (#8882) 2025-03-31 11:10:06 +02:00
Clarence
ee5dc1ae40
docs(react-guides): fixed cancelMutations typo (#8881) 2025-03-31 11:06:11 +02:00
Clarence
62b872051d
docs(react-community): fixed typescript typo (#8879) 2025-03-30 14:50:39 +02:00
Eva
b23bb3974c
docs: Update overview.md (#8859)
Updated several mentions of "React Query" to "TanStack Query".
Wrote "formerly known as" instead of using a not all that well known abbreviation to better support the multilingual audience.
2025-03-27 14:46:48 +01:00
Brandon Weeks
6d03341457
docs: Add Connect RPC to the list of community projects (#8850)
* docs: Add Connect RPC to the list of community projects

Connect RPC has a native TanStack Query integration.

https://github.com/connectrpc/connect-query-es

* 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-03-26 13:57:12 +01:00
Keyur Govrani
3064422e53
docs: fix ignored promise from invalidate queries (#8847)
* fix(examples): Promise returned from invalidateQueries being ignored in optimistic-updates-cache example

* fix(examples): Promise returned from invalidateQueries is ignored in optimistic-updates-ui example

* fix(docs): Promise returned from invalidateQueries is ignored in optimistic-updates documentation

* Update docs/framework/react/guides/optimistic-updates.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* refactor(docs, examples): standardize queryClient.invalidateQueries syntax in all onSettled callbacks

* 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-03-26 10:27:36 +01:00
Denis Shvets
04712b7bc1
docs: fix internal link (#8855)
* docs: fix internal link

* Update docs/framework/react/guides/query-invalidation.md

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2025-03-25 16:32:47 +01:00
Dominik Dorfmeister
fb1dffca7b
docs: Update testing.md 2025-03-24 11:00:44 +01:00
TkDodo
a9b073a85e docs: fix what prettier broke 2025-03-19 09:29:27 +01:00
TkDodo
bea2ff8726 docs: fix what prettier broke 2025-03-19 09:18:45 +01:00
TkDodo
4b7fd0e836 docs: fix internal links 2025-03-18 09:45:11 +01:00
TkDodo
980d08d464 docs: fix links in ssr guide 2025-03-18 08:55:56 +01:00
TkDodo
ff788ac4e0 docs: remove extra link 2025-03-17 12:49:52 +01:00
TkDodo
84b1bed9c3 docs: add .md to links 2025-03-17 12:37:05 +01:00
HYUNJOON
21c5e099b2
docs: Fix broken link some example path (#8813)
* docs: fix example path in "advanced-ssr.md"

* fix: broken example link
2025-03-17 12:36:03 +01:00
조우혁
d7f4cb09e2
docs: Fix broken links in query-options.md (#8800)
* fix: broken-link

* fix: remove .md
2025-03-13 17:33:57 +01:00
Julien Piron
edbb3046d0
docs: Fix broken links on ssr.md (#8792) 2025-03-13 16:37:45 +01:00
Harry
8bfa77b525
docs(react-query): fix incorrect link in documentation (#8699)
* docs(react-query): fix incorrect paths in documentation
The documentation contained incorrect file paths.
Fixed the incorrect paths to match the actual directory structure.

* docs(react-query): fixed incorrect relative path (./ -> ../)
2025-03-08 13:08:47 +01:00