fix(vue-query): preserve useQuery inference for spread queryOptions oβ¦#10975
fix(vue-query): preserve useQuery inference for spread queryOptions oβ¦#10975nijuse wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (2)
π WalkthroughWalkthroughReformats the ChangesUseQueryOptions spread type inference fix
Estimated code review effortπ― 2 (Simple) | β±οΈ ~5 minutes Possibly related issues
Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ 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 |
π― Changes
Fixes a type inference bug in
useQuerywhen spreadingqueryOptions()and overriding non-data-shaping options likeenabled.Root cause: In
UseQueryOptions,queryKeywas typed through the genericMaybeRefDeep<...>path (same as other options). When using the spread + override pattern,TQueryKeywas not preserved correctly and generics widened tounknown.Fix: Add a dedicated branch for
queryKey, typing it asMaybeRefOrGetter<TQueryKey>(similar to the existingenabledbranch). Both patterns now infer the samedatatype:β Checklist
pnpm run test:pr.π Release Impact
Summary by CodeRabbit
Tests
Refactor