fix(vue-query): unwrap getter options in fetchQuery - #11103
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesFetch query getter options
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized fix evaluates getter-based options before fetching and adds regression coverage; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Caller
participant VueQueryQueryClient
participant QueryClientOrigin
Caller->>VueQueryQueryClient: fetchQuery(getter)
VueQueryQueryClient->>VueQueryQueryClient: evaluate getter and deep-unref options
VueQueryQueryClient->>QueryClientOrigin: fetchQuery(unwrapped options)
Possibly related PRs
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/queryClient.ts`:
- Around line 36-41: Update the fetchQuery overload’s getter branch to accept ()
=> MaybeRefDeep<FetchQueryOptions<...>> instead of only () =>
FetchQueryOptions<...>, matching cloneDeepUnrefOrGet runtime support for
ref-bearing options while preserving the existing non-getter overload behavior.
🪄 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: 74cf3a52-8bdf-4c55-9ef2-fac18a9d7107
📒 Files selected for processing (3)
.changeset/vue-query-fetch-query-getter-options.mdpackages/vue-query/src/__tests__/queryClient.test.tspackages/vue-query/src/queryClient.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
View your CI Pipeline Execution ↗ for commit b7cdf5c
☁️ Nx Cloud last updated this comment at |
Fixes #11102
🎯 Changes
QueryClient.fetchQueryhas an overload that accepts a getter function returningFetchQueryOptions, but the runtime path passed that top-level function directly to query-core.This PR evaluates top-level getter options before applying the existing deep-unref behavior.
Changes included:
cloneDeepUnrefqueryClient.fetchQueryfetchQuery(() => options)@tanstack/vue-query✅ Checklist
pnpm run test:pr.🚀 Release Impact
Tests
pnpm run test:prpnpm nx run @tanstack/vue-query:test:lib -- queryClient.test.tspnpm nx run @tanstack/vue-query:test:typespnpm nx run @tanstack/vue-query:test:eslintpnpm exec prettier --check .changeset/vue-query-fetch-query-getter-options.md packages/vue-query/src/queryClient.ts packages/vue-query/src/__tests__/queryClient.test.tsSummary by CodeRabbit
New Features
fetchQuerynow accepts getter functions that return query options.Bug Fixes
fetchQuery.Documentation