* chore(scripts/generate-docs): inject 'redirect_from' into flat reference URLs
* docs(react-query, solid-query): add 'redirect_from' for URLs broken by the TypeDoc migration
* docs(vue-query,solid-query): inline react reference content instead of 'ref'-ing hand-written react docs
* docs(react-query): generate reference docs with TypeDoc
* docs(vue-query,solid-query): fix dangling suspense-hook links left over from the react content copy
* docs(solid-query): apply solid's callback call form to inlined reference examples
* docs(react-query): correct inaccurate JSDoc statements flagged in review
* docs(vue-query,solid-query): fix reactivity-aware examples and inaccurate type signatures flagged in review
* docs(vue-query,solid-query): fix remaining type/behavior inaccuracies flagged in second review
* docs(react-query): stop implying a default queryFn defers a fetch the way 'enabled: false' does
* docs(vue-query): mark 'mutate'/'mutateAsync' per-call options as optional
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>
* add community resources page
* update link for blog posts
* update community resource links
* rm vue community section
* update old links
* fix community resource link
* 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>
* 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>
* 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`.
* 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