File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1132,6 +1132,7 @@ const generateQueryHook = async (
1132
1132
override . query . useSuspenseQuery ||
1133
1133
override . query . useInfinite ||
1134
1134
override . query . useSuspenseInfiniteQuery ) ;
1135
+
1135
1136
if ( operationQueryOptions ?. useInfinite !== undefined ) {
1136
1137
isQuery = operationQueryOptions . useInfinite ;
1137
1138
}
@@ -1145,16 +1146,22 @@ const generateQueryHook = async (
1145
1146
isQuery = operationQueryOptions . useSuspenseQuery ;
1146
1147
}
1147
1148
1148
- // For non-GET operations, only register query OR mutation hooks, not both
1149
- let isMutation =
1150
- verb !== Verbs . GET &&
1151
- ( operationQueryOptions ?. useMutation || override . query . useMutation ) ;
1149
+ let isMutation = override . query . useMutation && verb !== Verbs . GET ;
1150
+
1151
+ if ( operationQueryOptions ?. useMutation !== undefined ) {
1152
+ isMutation = operationQueryOptions . useMutation ;
1153
+ }
1152
1154
1153
1155
// If both query and mutation are true for a non-GET operation, prioritize query
1154
1156
if ( verb !== Verbs . GET && isQuery ) {
1155
1157
isMutation = false ;
1156
1158
}
1157
1159
1160
+ // If both query and mutation are true for a GET operation, prioritize mutation
1161
+ if ( verb === Verbs . GET && isMutation ) {
1162
+ isQuery = false ;
1163
+ }
1164
+
1158
1165
if ( isQuery ) {
1159
1166
const queryKeyMutator = query . queryKey
1160
1167
? await generateMutator ( {
You can’t perform that action at this time.
0 commit comments