feat(types): support typing QueryKey and MutationKey via Register#8521
feat(types): support typing QueryKey and MutationKey via Register#8521TkDodo merged 3 commits intoTanStack:mainfrom
QueryKey and MutationKey via Register#8521Conversation
|
View your CI Pipeline Execution ↗ for commit 2b07bbe.
☁️ Nx Cloud last updated this comment at |
|
Hi! I'm I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
|
|
@TkDodo thanks! I've just fixed the failing build, so hopefully a rerun will be green 🤞🏾 |
QueryKey and MutationKey via Register
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8521 +/- ##
===========================================
+ Coverage 46.28% 63.04% +16.76%
===========================================
Files 199 135 -64
Lines 7538 4833 -2705
Branches 1722 1354 -368
===========================================
- Hits 3489 3047 -442
+ Misses 3670 1542 -2128
+ Partials 379 244 -135 |
|
autofix is still failing. please run prettier or allow updates by maintainers so that this can be fixed by the bot! |
ce6952b to
b4ea0d6
Compare
|
@TkDodo thanks! annoyingly prettier was unable to find any fixes (at least with how I was running it in my Codespace). I've just allowed maintainer edits, and have pushed a new commit |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@tanstack/react-query](https://tanstack.com/query) ([source](https://github.com/TanStack/query/tree/HEAD/packages/react-query)) | dependencies | minor | [`5.62.16` -> `5.64.0`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query/5.62.16/5.64.0) | | [@tanstack/react-query-devtools](https://tanstack.com/query) ([source](https://github.com/TanStack/query/tree/HEAD/packages/react-query-devtools)) | dependencies | minor | [`5.62.16` -> `5.64.0`](https://renovatebot.com/diffs/npm/@tanstack%2freact-query-devtools/5.62.16/5.64.0) | --- ### Release Notes <details> <summary>TanStack/query (@​tanstack/react-query)</summary> ### [`v5.64.0`](https://github.com/TanStack/query/releases/tag/v5.64.0) [Compare Source](TanStack/query@v5.63.0...v5.64.0) Version 5.64.0 - 1/11/25, 6:59 PM ##### Changes ##### Feat - types: support typing `QueryKey` and `MutationKey` via `Register` ([#​8521](TanStack/query#8521)) ([`fd500a4`](TanStack/query@fd500a4)) by [@​neefrehman](https://github.com/neefrehman) ##### Docs - react-query: highlight per component select pattern for query options ([#​8522](TanStack/query#8522)) ([`8ddebc6`](TanStack/query@8ddebc6)) by [@​DogPawHat](https://github.com/DogPawHat) - react-query: Add import statement with skipToken to the docs ([#​8519](TanStack/query#8519)) ([`690fd2a`](TanStack/query@690fd2a)) by Przemek Maszczynski ##### Packages - [@​tanstack/query-core](https://github.com/tanstack/query-core)[@​5](https://github.com/5).64.0 - [@​tanstack/query-broadcast-client-experimental](https://github.com/tanstack/query-broadcast-client-experimental)[@​5](https://github.com/5).64.0 - [@​tanstack/query-persist-client-core](https://github.com/tanstack/query-persist-client-core)[@​5](https://github.com/5).64.0 - [@​tanstack/query-sync-storage-persister](https://github.com/tanstack/query-sync-storage-persister)[@​5](https://github.com/5).64.0 - [@​tanstack/react-query](https://github.com/tanstack/react-query)[@​5](https://github.com/5).64.0 - [@​tanstack/react-query-devtools](https://github.com/tanstack/react-query-devtools)[@​5](https://github.com/5).64.0 - [@​tanstack/react-query-persist-client](https://github.com/tanstack/react-query-persist-client)[@​5](https://github.com/5).64.0 - [@​tanstack/react-query-next-experimental](https://github.com/tanstack/react-query-next-experimental)[@​5](https://github.com/5).64.0 - [@​tanstack/solid-query](https://github.com/tanstack/solid-query)[@​5](https://github.com/5).64.0 - [@​tanstack/solid-query-devtools](https://github.com/tanstack/solid-...
Follow-on from #8495
This PR extends the use of the
Registerinterface so that it can narrow the type ofQueryKeyandMutationKey, for situations where users of the library want to enforce a hierarchy of keys at the lowest-level possible.