fix(core): Add pageParam type to QueryFunction generic types - #5623
Conversation
Although QueryFunctionContext allows setting the pageParam type through generics, QueryFunction uses QueryFunctionContext without exposing this typing functionality. This forces any queryFn typed as a QueryFunction to have an `any` pageParam. This change adds TPageParam to QueryFunction type, which is passed through to QueryFunctionContext. This should be backward compatible and only affects typing (not runtime code).
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
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 10fd276:
|
|
yeah I think we can merge this, but we've also fixed this holistically on v5 where the type of |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 10fd276. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #5623 +/- ##
==========================================
- Coverage 92.19% 91.81% -0.39%
==========================================
Files 112 101 -11
Lines 4294 3908 -386
Branches 1127 985 -142
==========================================
- Hits 3959 3588 -371
+ Misses 314 299 -15
Partials 21 21
☔ View full report in Codecov by Sentry. |
|
@TkDodo wanted to check if there was anything you'd like me to do here? Noticed the react 17 test suite is failing, but appears to be unrelated. |
Although QueryFunctionContext allows setting the pageParam type through generics, QueryFunction uses QueryFunctionContext without exposing this typing functionality. This forces any queryFn typed as a QueryFunction to have an
anypageParam. This change adds TPageParam to QueryFunction type, which is passed through to QueryFunctionContext.This should be backward compatible and only affects typing (not runtime code).