Skip to content

Commit a46bc87

Browse files
authored
fix(solid-query): Default reconcile to false (#6125)
1 parent a61958e commit a46bc87

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/solid-query/src/QueryClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface QueryObserverOptions<
3030
* Set this to a reconciliation key to enable reconciliation between query results.
3131
* Set this to `false` to disable reconciliation between query results.
3232
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
33-
* Defaults reconciliation key to `id`.
33+
* Defaults reconciliation to false.
3434
*/
3535
reconcile?:
3636
| string
@@ -60,7 +60,7 @@ export interface InfiniteQueryObserverOptions<
6060
* Set this to a reconciliation key to enable reconciliation between query results.
6161
* Set this to `false` to disable reconciliation between query results.
6262
* Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic.
63-
* Defaults reconciliation key to `id`.
63+
* Defaults reconciliation to false.
6464
*/
6565
reconcile?:
6666
| string

packages/solid-query/src/__tests__/createQuery.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,7 @@ describe('createQuery', () => {
10461046
count++
10471047
return count === 1 ? result1 : result2
10481048
},
1049+
reconcile: 'id',
10491050
}))
10501051

10511052
createRenderEffect(() => {

packages/solid-query/src/createBaseQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function createBaseQuery<
111111
const isRestoring = useIsRestoring()
112112

113113
const defaultedOptions = createMemo(() =>
114-
mergeProps(client().defaultQueryOptions(options()), {
114+
mergeProps(client()?.defaultQueryOptions(options()) || {}, {
115115
get _optimisticResults() {
116116
return isRestoring() ? 'isRestoring' : 'optimistic'
117117
},
@@ -167,7 +167,7 @@ export function createBaseQuery<
167167
return reconcileFn(
168168
store,
169169
result,
170-
reconcileOptions === undefined ? 'id' : reconcileOptions,
170+
reconcileOptions === undefined ? false : reconcileOptions,
171171
)
172172
})
173173
// If the query has data we dont suspend but instead mutate the resource

0 commit comments

Comments
 (0)