Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-taxis-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@softnetics/hono-react-query": patch
---

fix: update hono@4.11.4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"peerDependencies": {
"@tanstack/react-query": ">=5.71.5",
"hono": ">=4.10.1"
"hono": ">=4.11.4"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function responseParser(response: Response, throwOnError?: boolean): Promi
}

function useQueryFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): UseHonoQuery<T> {
return (path, method, honoPayload, hookOptions) => {
return useQuery(
Expand All @@ -105,7 +105,7 @@ function useQueryFactory<T extends Record<string, any>>(
}

function useSuspenseQueryFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): UseHonoSuspenseQuery<T> {
return (path, method, honoPayload, hookOptions) => {
return useSuspenseQuery(
Expand All @@ -115,7 +115,7 @@ function useSuspenseQueryFactory<T extends Record<string, any>>(
}

function queryOptionsFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): HonoQueryOptions<T> {
return (path, method, honoPayload, hookOptions) => {
const paths = [...path.toString().split('/').filter(Boolean), method.toString()]
Expand All @@ -140,7 +140,7 @@ function queryOptionsFactory<T extends Record<string, any>>(
}

function suspenseQueryOptionsFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): HonoSuspenseQueryOptions<T> {
return (path, method, honoPayload, hookOptions) => {
const paths = [...path.toString().split('/').filter(Boolean), method.toString()]
Expand All @@ -165,7 +165,7 @@ function suspenseQueryOptionsFactory<T extends Record<string, any>>(
}

function useMutationFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): UseHonoMutation<T> {
return ((path, method, honoOptions, hookOptions) => {
return useMutation(
Expand All @@ -175,7 +175,7 @@ function useMutationFactory<T extends Record<string, any>>(
}

function mutationOptionsFactory<T extends Record<string, any>>(
client: Record<string, ClientRequest<any>>
client: Record<string, ClientRequest<any, any, any>>
): HonoMutationOptions<T> {
return ((path, method, honoOptions, hookOptions) => {
const paths = [...path.toString().split('/').filter(Boolean), method.toString()]
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type Client<T> =
T extends HonoBase<any, infer TSchema, any>
? TSchema extends Record<infer TPath, Schema>
? TPath extends string
? { [K in TPath]: ClientRequest<TSchema[TPath]> }
? { [K in TPath]: ClientRequest<'/', TPath, TSchema[TPath]> }
: never
: never
: never
Expand Down
Loading