-
Couldn't load subscription status.
- Fork 108
fix(query-db-collection): respect QueryClient defaultOptions when not overriden #707
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(query-db-collection): respect QueryClient defaultOptions when not overriden #707
Conversation
… overridden Previously, queryCollectionOptions would set query options (staleTime, retry, retryDelay, refetchInterval, enabled, meta) to undefined even when not provided in the config. This prevented QueryClient's defaultOptions from being used as fallbacks. The fix conditionally includes these options in the observerOptions object only when they are explicitly defined (not undefined), allowing TanStack Query to properly use defaultOptions from the QueryClient. Added comprehensive tests to verify: 1. defaultOptions are respected when not overridden in queryCollectionOptions 2. explicit options in queryCollectionOptions override defaultOptions 3. retry behavior from defaultOptions works correctly Fixes issue where users couldn't use QueryClient defaultOptions with QueryCollection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: fa1ac86 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 |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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: |
|
Size Change: 0 B Total Size: 84.3 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
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.
Looks good to me ![]()
|
🎉 This PR has been released! Thank you for your contribution! |
Previously, queryCollectionOptions would set query options (staleTime, retry, retryDelay, refetchInterval, enabled, meta) to undefined even when not provided in the config. This prevented QueryClient's defaultOptions from being used as fallbacks.
The fix conditionally includes these options in the observerOptions object only when they are explicitly defined (not undefined), allowing TanStack Query to properly use defaultOptions from the QueryClient.
Added comprehensive tests to verify:
Fixes issue where users couldn't use QueryClient defaultOptions with QueryCollection
🤖 Generated with Claude Code
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact