Skip to content

Commit 288f488

Browse files
authoredFeb 7, 2024
fix: useMutation still appears even if false (#1209)
1 parent 9f16e37 commit 288f488

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎packages/query/src/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1299,9 +1299,10 @@ const generateQueryHook = async (
12991299
: undefined;
13001300
}
13011301

1302-
const isMutation =
1303-
(verb !== Verbs.GET && override.query.useMutation) ||
1304-
operationQueryOptions?.useMutation;
1302+
let isMutation = verb !== Verbs.GET && override.query.useMutation;
1303+
if (operationQueryOptions?.useMutation !== undefined) {
1304+
isMutation = operationQueryOptions.useMutation;
1305+
}
13051306

13061307
if (isMutation) {
13071308
const mutationOptionsMutator = query.mutationOptions

0 commit comments

Comments
 (0)
Please sign in to comment.