-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(react-query): add missing subscribed option to UseInfiniteQueryOp… #8546
fix(react-query): add missing subscribed option to UseInfiniteQueryOp… #8546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, thanks for trying ❤️
View your CI Pipeline Execution ↗ for commit 03c603c.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8546 +/- ##
===========================================
+ Coverage 46.28% 84.29% +38.01%
===========================================
Files 199 26 -173
Lines 7538 363 -7175
Branches 1721 102 -1619
===========================================
- Hits 3489 306 -3183
+ Misses 3670 48 -3622
+ Partials 379 9 -370
|
This pull request adds the missing
subscribed
option to theUseInfiniteQueryOptions
type, as discussed in #8538.Context
Both
useQuery
anduseInfiniteQuery
rely onuseBaseQuery
under the hood, and the subscription logic resides inuseBaseQuery
. However, the options type foruseInfiniteQuery
does not currently extendUseBaseQueryOptions
, which would seem logical given their shared base.Approach
Initially, I attempted to make
UseInfiniteQueryOptions
extendUseBaseQueryOptions
. To achieve this, I broadenedUseBaseQueryOptions
to accept an additional generic parameter,TPageParam
, required for infinite queries. However, this caused a lot of type breaks throughout the codebase, asUseBaseQueryOptions
appears to have been designed specifically foruseQuery
.To avoid widespread changes and potential compatibility issues, I decided to stick with the existing approach. Instead, I directly added the
subscribed
field toUseInfiniteQueryOptions
. This resolves the issue for now without disrupting other parts of the type system.