Conversation
📝 WalkthroughWalkthroughThis PR extends the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit b40fb96
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 23 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
size-limit report 📦
|
# Conflicts: # packages/vue-query/src/queryOptions.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/query-core/src/types.ts (1)
113-121:⚠️ Potential issue | 🟠 MajorAvoid a type-level breaking change by keeping
Enabledas a deprecated alias.Renaming the exported alias to
QueryBooleanOptioncan break consumers importingEnabledfrom query-core. Please keep a compatibility alias.🔧 Backward-compatible type alias
export type QueryBooleanOption< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, > = | boolean | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean) + +/** `@deprecated` Use `QueryBooleanOption` instead. */ +export type Enabled< + TQueryFnData = unknown, + TError = DefaultError, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +> = QueryBooleanOption<TQueryFnData, TError, TData, TQueryKey>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/query-core/src/types.ts` around lines 113 - 121, Keep a backward-compatible deprecated alias by exporting Enabled as an alias of QueryBooleanOption so existing consumers don't break; locate the type QueryBooleanOption and add an exported type alias named Enabled that points to QueryBooleanOption and mark it deprecated in a comment or JSDoc so downstream code can still import Enabled while signalling it will be removed later.
🧹 Nitpick comments (1)
packages/react-query/src/__tests__/useQuery.test.tsx (1)
6910-6912: Tighten callback assertion to avoid false positives.This test currently allows extra callback invocations. Since it verifies invocation semantics, asserting exact count makes it stricter.
♻️ Suggested test hardening
- expect(retryOnMount).toHaveBeenCalled() + expect(retryOnMount).toHaveBeenCalledTimes(1) const query = retryOnMount.mock.calls.at(-1)![0]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react-query/src/__tests__/useQuery.test.tsx` around lines 6910 - 6912, The test currently allows extra invocations of the mock retryOnMount which can mask incorrect behavior; tighten the assertion by explicitly checking the exact number of calls (e.g., expect(retryOnMount).toHaveBeenCalledTimes(1)) before inspecting the last call, then continue to grab the single call (retryOnMount.mock.calls[0] or .at(0)) and assert query.state.status === 'error'; update the useQuery.test.tsx assertion around the retryOnMount mock to enforce exact call count and use the specific call index when creating the query variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/query-core/src/types.ts`:
- Around line 113-121: Keep a backward-compatible deprecated alias by exporting
Enabled as an alias of QueryBooleanOption so existing consumers don't break;
locate the type QueryBooleanOption and add an exported type alias named Enabled
that points to QueryBooleanOption and mark it deprecated in a comment or JSDoc
so downstream code can still import Enabled while signalling it will be removed
later.
---
Nitpick comments:
In `@packages/react-query/src/__tests__/useQuery.test.tsx`:
- Around line 6910-6912: The test currently allows extra invocations of the mock
retryOnMount which can mask incorrect behavior; tighten the assertion by
explicitly checking the exact number of calls (e.g.,
expect(retryOnMount).toHaveBeenCalledTimes(1)) before inspecting the last call,
then continue to grab the single call (retryOnMount.mock.calls[0] or .at(0)) and
assert query.state.status === 'error'; update the useQuery.test.tsx assertion
around the retryOnMount mock to enforce exact call count and use the specific
call index when creating the query variable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2a7bf7f7-810e-4787-93e1-3f308f5094c4
📒 Files selected for processing (14)
.changeset/silver-places-pick.mddocs/framework/react/reference/useQuery.mddocs/framework/solid/reference/useQuery.mdpackages/preact-query/src/__tests__/QueryResetErrorBoundary.test.tsxpackages/preact-query/src/__tests__/useQuery.test.tsxpackages/query-core/src/query.tspackages/query-core/src/queryObserver.tspackages/query-core/src/types.tspackages/query-core/src/utils.tspackages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsxpackages/react-query/src/__tests__/useQuery.test.tsxpackages/solid-query/src/__tests__/useQuery.test.tsxpackages/vue-query/src/queryOptions.tspackages/vue-query/src/useQuery.ts
Summary by CodeRabbit
Release Notes
New Features
retryOnMountoption now supports callback functions that receive the query object to determine retry behavior on mount.Documentation
retryOnMountdocumentation across React, Solid, and Vue frameworks with the new callback function signature.Bug Fixes
retryOnMount: falsebehavior to only prevent retry when the query has an error and no data.