Skip to content

Commit

Permalink
fix: useMutation still appears even if false
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Feb 7, 2024
1 parent 84a9ac7 commit d614897
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1299,9 +1299,10 @@ const generateQueryHook = async (
: undefined;
}

const isMutation =
(verb !== Verbs.GET && override.query.useMutation) ||
operationQueryOptions?.useMutation;
let isMutation = verb !== Verbs.GET && override.query.useMutation;
if (isMutation && operationQueryOptions?.useMutation) {
isMutation = false;
}

if (isMutation) {
const mutationOptionsMutator = query.mutationOptions
Expand Down

0 comments on commit d614897

Please sign in to comment.