feat(query-core, react-query): backport v5 types, deprecate `isLoading` in favor of `isPending` in mutation observer results
Deprecation and Property to enhance migration to v5 gradually:
- Marked
isLoadingproperty as deprecated in multipleMutationObserverresult interfaces (MutationObserverBaseResult,MutationObserverIdleResult,MutationObserverLoadingResult,MutationObserverErrorResult,MutationObserverSuccessResult) and added theisPendingproperty as its replacement.
Type backport like v5:
- Exported
UseSuspenseQueryOptions,UseSuspenseQueryResult,SuspenseQueriesResults,SuspenseQueriesOptions,DefinedInitialDataOptions, andUndefinedInitialDataOptions,DefinedInitialDataOptionsandUndefinedInitialDataOptionstypes like v5
Many people are still on v4, and the same is true for my company. If we backport some of the v5 APIs to v4 well, it would ease their migration and reduce friction. This can help accelerate the adoption of v5 eventually, allowing us to concentrate our efforts on v5 improvements.
What I want to backport after this Pull Request
-
useSuspenseInfiniteQuery -
infiniteQueryOptions
View your CI Pipeline Execution ↗ for commit 569efbb26759be1008610990d689551dd21e7eea.
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:lib,test:types,test:... |
✅ Succeeded | 1m 19s | View ↗ |
nx affected --targets=test:lib --base=79f0b9ad2... |
✅ Succeeded | <1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-06-11 16:21:32 UTC
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 569efbb26759be1008610990d689551dd21e7eea:
| Sandbox | Source |
|---|---|
| @tanstack/query-example-react-basic-typescript | Configuration |
| @tanstack/query-example-solid-basic-typescript | Configuration |
| @tanstack/query-example-svelte-basic | Configuration |
| @tanstack/query-example-vue-basic | Configuration |
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.62%. Comparing base (
84e8ae5) to head (569efbb). Report is 29 commits behind head on v4.
Additional details and impacted files
@@ Coverage Diff @@
## v4 #9266 +/- ##
==========================================
- Coverage 95.16% 91.62% -3.54%
==========================================
Files 13 117 +104
Lines 496 4478 +3982
Branches 179 1184 +1005
==========================================
+ Hits 472 4103 +3631
- Misses 23 344 +321
- Partials 1 31 +30
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
This resolve this eslint warning