fix(vue-query): export queryOptions declaration types#11098
fix(vue-query): export queryOptions declaration types#11098ousamabenyounes wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthrough
ChangesVue Query options type surface
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vue-query/src/queryOptions.ts`:
- Around line 68-71: Update QueryOptionsDataTag so its queryKey property
preserves the reactive MaybeRefOrGetter<TQueryKey> shape while retaining the
DataTag<TQueryKey, TQueryFnData, TError> metadata. Keep the existing omission
and tagging behavior unchanged, ensuring refs and getters remain valid in the
returned options type.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 668e95eb-d1d5-4dcf-8b09-09a6b78764aa
📒 Files selected for processing (5)
.changeset/calm-vue-query-options.mdpackages/query-core/src/index.tspackages/vue-query/src/__tests__/queryOptions.test-d.tspackages/vue-query/src/index.tspackages/vue-query/src/queryOptions.ts
🎯 Changes
queryOptionsdeclaration types from Vue Query.ref,computed, and getterqueryKeyshapes while retainingDataTagmetadata.useQueryinitial-data helper types available asUndefinedInitialUseQueryOptionsandDefinedInitialUseQueryOptions.Fixes #11042
✅ Checklist
pnpm run test:pr.Targeted local verification:
pnpm exec nx run @tanstack/vue-query:test:types --skip-nx-cachepnpm exec nx run @tanstack/vue-query:build --skip-nx-cache🚀 Release Impact
Summary by CodeRabbit
queryOptionsTypeScript inference forqueryKeyand betterselectnarrowing—especially for portablequeryOptionsfactory patterns.