Skip to content

Commit 1bd0a84

Browse files
authored
query: fix optional params (#11)
1 parent f62cb23 commit 1bd0a84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/createUseQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const createUseQuery = (
2929
ts.factory.createPropertySignature(
3030
undefined,
3131
ts.factory.createIdentifier(param.name.getText(node)),
32-
undefined,
32+
param.questionToken ?? param.initializer ? ts.factory.createToken(ts.SyntaxKind.QuestionToken) : param.questionToken,
3333
param.type
3434
)
3535
)

0 commit comments

Comments
 (0)