-
Notifications
You must be signed in to change notification settings - Fork 152
feat: Add select option to extract items while preserving metadata #551
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <noreply@anthropic.com>
KyleAMathews
left a comment
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.
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