Skip to content

Commit 3240a7c

Browse files
committed
Allow no Query prefixes
1 parent 70f1c2e commit 3240a7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/client/client.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ type ExtractKeys<Config extends ApiTemplate> = {
2424
? MethodName
2525
: never
2626
}[keyof Config]
27-
type QueryNameTemplates<Prefixes extends string[]> = {
28-
[Prefix in keyof Prefixes]: `${Prefixes[Prefix]}${string}`
29-
}[number]
27+
type QueryNameTemplates<Prefixes extends string[]> = Prefixes extends []
28+
? string
29+
: {
30+
[Prefix in keyof Prefixes]: `${Prefixes[Prefix]}${string}`
31+
}[number]
3032
type QueryPaths<Contract extends ApiTemplate, Prefixes extends string[]> = {
3133
[QueryName in keyof Contract]-?: QueryName extends QueryNameTemplates<Prefixes>
3234
? Contract[QueryName] extends Function

0 commit comments

Comments
 (0)