Skip to content

Commit

Permalink
fix: overridden non-GET queries not generating hooks (#1251)
Browse files Browse the repository at this point in the history
* fix: generateQueryHook now respects operationQueryOptions

* fix: consistent ordering of query conditions
  • Loading branch information
ponbac committed Mar 5, 2024
1 parent 6028c17 commit 05bb15b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ const generateQueryHook = async (
.join(',');

const queries = [
...(query?.useInfinite
...(query?.useInfinite || operationQueryOptions?.useInfinite
? [
{
name: camel(`${operationName}-infinite`),
Expand All @@ -1218,7 +1218,7 @@ const generateQueryHook = async (
},
]
: []),
...(query?.useQuery
...(query?.useQuery || operationQueryOptions?.useQuery
? [
{
name: operationName,
Expand All @@ -1227,7 +1227,7 @@ const generateQueryHook = async (
},
]
: []),
...(query?.useSuspenseQuery
...(query?.useSuspenseQuery || operationQueryOptions?.useSuspenseQuery
? [
{
name: camel(`${operationName}-suspense`),
Expand All @@ -1236,7 +1236,8 @@ const generateQueryHook = async (
},
]
: []),
...(query?.useSuspenseInfiniteQuery
...(query?.useSuspenseInfiniteQuery ||
operationQueryOptions?.useSuspenseInfiniteQuery
? [
{
name: camel(`${operationName}-suspense-infinite`),
Expand Down

0 comments on commit 05bb15b

Please sign in to comment.