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

29 commits

Author SHA1 Message Date
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
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
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
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
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
우혁
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
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
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
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
Mohammad Reza Badri
0e1d866dfe
docs: correct missing closing quote in networkMode option (#8965) 2025-04-07 14:21:06 +02:00
TkDodo
4b7fd0e836 docs: fix internal links 2025-03-18 09:45:11 +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
Joseph Markus
67e52cf889
docs: Fix 404 link for Query Keys in useQuery.md (#8769)
Current link takes to https://tanstack.com/query/latest/docs/framework/guides/query-keys which is a 404
2025-03-07 19:19:55 +01:00
Alex Errant
bb25d06980
docs: better document throwOnError's default (#8581)
* better document `throwOnError`'s default

* delete unnecessary defaultOptions doc
2025-02-16 16:26:57 +01:00
Dominik Dorfmeister
e2bc2165fa
feat(react-query): allow useQuery and useQueries to unsubscribe from the query cache with an option (#8348)
* feat(react-query): allow useQuery and useQueries to unsubscribe from the query cache with an option

* test: subscribed

* fix: revert calling getOptimisticResult later

* docs(react): update the react-native.md section (#8506)

* update the doc

* update the doc

---------

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

* docs: reference

---------

Co-authored-by: Florian De la comble <f.delacomble@gmail.com>
2025-01-08 15:17:08 +01:00
gnerkus
a76ac59e97
docs(useQuery): add more info to description of staleTime field of query options (#8448) 2024-12-18 10:13:29 +01:00
Alex / KATT
18953be6f6
feat: add support for React.use() (#7988)
* let’s do it again

* fix test group

* maybe

* mkay

* cool

* rm console.logs

* mkay

* mkay

* fix(vue-query): invalidate queries immediately after calling `invalidateQueries` (#7930)

* fix(vue-query): invalidate queries immediately after call `invalidateQueries`

* chore: recovery code comments

* release: v5.53.2

* docs(vue-query): update SSR guide for nuxt2 (#8001)

* docs: update SSR guide for nuxt2

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* thenable

* mkay

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

* mkay

* mkay

* faster and more consistent

* mkay

* mkay

* mkay

* mkay

* mkay

* fix unhandled rejections

* more

* more

* mkay

* fix more

* fixy

* cool

* Update packages/react-query/package.json

* fix: track data property if `promise` is tracked

if users use the `promise` returned from useQuery, they are actually interested in the `data` it unwraps to. Since the promise doesn't change when data resolves, we would likely miss a re-render

* Revert "fix: track data property if `promise` is tracked"

This reverts commit d1184babd1.

* add test case that @tkdodo was concerned about

* tweak

* mkay

* add `useInfiniteQuery()` test

* consistent testing

* better test

* rm comment

* test resetting errror boundary

* better test

* cool

* cool

* more test

* mv cleanup

* mkay

* some more things

* add fixme

* fix types

* wat

* fixes

* revert

* fix

* colocating doesn’t workkk

* mkay

* mkay

* might work

* more test

* cool

* i don’t know hwat i’m doing

* mocky

* lint

* space

* rm log

* setIsServer

* mkay

* ffs

* remove unnecessary stufffff

* tweak more

* just naming and comments

* tweak

* fix: use fetchOptimistic util instead of observer.fetchOptimistic

* refactor: make sure to only trigger fetching during render if we really have no cache entry yet

* fix: move the `isNewCacheEntry` check before observer creation

* chore: avoid rect key warnings

* fix: add an `updateResult` for all observers to finalize currentThenable

* chore: logs during suspense errors

* fix: empty catch

* feature flag

* add comment

* simplify

* omit from suspense

* feat flag

* more tests

* test: scope experimental_promise to useQuery().promise tests

* refactor: rename to experimental_prefetchInRender

* test: more tests

* test: more cancelation

* fix cancellation

* make it work

* tweak comment

* Update packages/react-query/src/useBaseQuery.ts

* simplify code a bit

* Update packages/query-core/src/queryObserver.ts

* refactor: move experimental_prefetchInRender check until after the early bail-out

* fix: when cancelled, the promise should stay pending

* test: disabled case

* chore: no idea what's going on

* refactor: delete unnecessary check

* revert refactor i did for cancellation when we wanted it to `throw`

* add docs

* align

* tweak

* Update docs/reference/QueryClient.md

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

---------

Co-authored-by: Alex Liu <dsa1314@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-01 17:39:37 +02:00
baeharam
9da00d610a
docs(react-query): fix queryClient description of useMutation and use… (#8077)
* docs(react-query): fix queryClient description of useMutation and useQuery

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-21 15:52:41 +02:00
wing
0c671eecb7
fix(query-core): allow function value of notifyOnChangeProps query option to return undefined (#7441)
* fix(query-core): allow function value of `notifyOnChangeProps` query option to return `undefined`

`undefined` is a valid return value for the function value of `notifyOnChangeProps`. See linked issue for more details.

Fixes #7426.

* docs(react-query): update signature of `useQuery`'s `notifyOnChangeProps` option

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-07-18 08:52:20 +02:00
John
31b9ab49af
feat(core): Add possibility to pass a callback to enabled. (#7566)
* Add possibility to pass a callback to enabled.

* Refactor into using the same pattern as resolving staletime, with the use of a resolveEnabled util function

* Update tests for enabled option as a callback

* update docs

* remove typo

* Update enabled type in docs

* remove duplicated test case

* Fix eslint errors

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: John Pettersson <john.pettersson@carnegie.se>
2024-06-25 16:10:16 +02:00
Dominik Dorfmeister
96a743eec7
feat(query-core): staleTime as a function (#7541)
* feat: staleTime as a function

* test: staleTime as a function

* refactor: types

* docs: staleTime as function
2024-06-11 15:11:40 +02:00
fuko
8fa82653dd
docs: fix broken internal links in the query docs (#7247)
* wip - 1

* Fix more links

* Fix one more link

* Another one

* Update a link

* Fix the broken links in the Angular docs

* Fix the broken links in the Vue docs

* Fix the Svelte links in the docs

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-22 10:38:13 +02:00
Christopher Ehrlich
fca5e7df77
docs: correct useQuery status type (#7252) 2024-04-09 18:07:17 +02:00
Dominik Dorfmeister
e707c13ce3
docs: render optimizations (#7234)
* docs: render optimizations

* docs: further reading
2024-04-05 20:06:06 +02:00
Tanner Linsley
754640a3e5
docs: migrate docs to use path-based navigation instead of route-based (#7211)
TanStack Router uses path-based navigation instead of route-based navigation, so many of the relative documentation links will be invalid after migration. This fixes that.
2024-04-02 16:46:31 -06:00
Gioele Vuaran
0123c8094d
docs: gcTime max value (#7190) 2024-04-02 17:15:08 +02:00
Dominik Dorfmeister
aad40787e4
fix(types): type structural sharing as unknown (#6888) 2024-02-13 13:46:31 +01:00
Lachlan Collins
5a5b61b19b
docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
Lachlan Collins
0cdbd5a198
docs: Re-organise for new docs layout (#6763)
* docs: Re-organise for v2 docs layout

* Add $schema
2024-01-26 07:57:22 +11:00
Renamed from docs/react/reference/useQuery.md (Browse further)