fix(react-query): Allow optional initialData object in infiniteQueryOptions#8157
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2cd4d37. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8157 +/- ##
===========================================
+ Coverage 45.41% 81.89% +36.48%
===========================================
Files 200 26 -174
Lines 7456 359 -7097
Branches 1696 99 -1597
===========================================
- Hits 3386 294 -3092
+ Misses 3694 56 -3638
+ Partials 376 9 -367
|
##### v5.59.8 (`https://github.com/TanStack/query/releases/tag/v5.59.8`) Version 5.59.8 - 10/9/24, 7:10 PM #### Changes ##### Fix - allow optional initialData object ([#8157](TanStack/query#8157)) ([`329b5f8`](TanStack/query@329b5f8)) by Jimmy Callin #### Packages - [@tanstack/react-query](https://github.com/tanstack/react-query)[@5](https://github.com/5).59.8 - [@tanstack/react-query-devtools](https://github.com/tanstack/react-query-devtools)[@5](https://github.com/5).59.8 - [@tanstack/react-query-persist-client](https://github.com/tanstack/react-query-persist-client)[@5](https://github.com/5).59.8 - [@tanstack/react-query-next-experimental](https://github.com/tanstack/react-query-next-experimental)[@5](https://github.com/5).59.8
##### v5.59.8 (`https://github.com/TanStack/query/releases/tag/v5.59.8`) Version 5.59.8 - 10/9/24, 7:10 PM #### Changes ##### Fix - allow optional initialData object ([#8157](TanStack/query#8157)) ([`329b5f8`](TanStack/query@329b5f8)) by Jimmy Callin #### Packages - [@tanstack/react-query](https://github.com/tanstack/react-query)[@5](https://github.com/5).59.8 - [@tanstack/react-query-devtools](https://github.com/tanstack/react-query-devtools)[@5](https://github.com/5).59.8 - [@tanstack/react-query-persist-client](https://github.com/tanstack/react-query-persist-client)[@5](https://github.com/5).59.8 - [@tanstack/react-query-next-experimental](https://github.com/tanstack/react-query-next-experimental)[@5](https://github.com/5).59.8
|
I like what you did! Then how about queryOptions? Does this need to be fixed too? |
|
Sure, if we can reproduce a situation that fails, please file a PR with a failing test and a fix :) |
|
Should this work in Let me know if I need to open separate issue regarding this |
This is a follow-up on #8154 and the post-merge discussion.
This resolves a TS issue where you cannot pass an optional initialData object to the infiniteQueryOptions function. The previous referred solution only handled initialData callback functions.