feat: Add select option to extract items while preserving metadata#551
feat: Add select option to extract items while preserving metadata#551KyleAMathews merged 13 commits intoTanStack:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 9eb0135 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Hi @KyleAMathews @samwillis would you mind taking a quick look at my PR ? im open to any feedback you might have |
samwillis
left a comment
There was a problem hiding this comment.
Thanks @0xlakshan, this is great and perfectly matches the proposed design from @KyleAMathews. A couple of other inline comments along with:
-
I don't suppose you could add the option to the docs in
docs/collections/query-collection.md? -
It also needs a changeset - run
pnpm changesetrepo root and follow the instructions. This would be a patch release at this point.
|
All done! @samwillis , thanks for the feedback |
- Enhanced error messages to include package name, error type, received value type, and queryKey for easier debugging - Added negative type test to verify TypeScript catches wrapped response data without select function - Updated existing runtime tests to handle improved error messaging - Fixed eslint warnings for unnecessary conditions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
KyleAMathews
left a comment
There was a problem hiding this comment.
Great work! Thanks for taking this on! Sorry for the delay getting it merged 🙏
Description
Added a new select option to QueryCollectionConfig that lets developers extract item arrays from wrapped API responses (e.g., with pagination or metadata) while preserving the full response in the TanStack Query cache.
Changes
Todo
Related Issue - #345