Skip to content

Commit

Permalink
fix(query): always return undefined instead of nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Brock committed May 16, 2023
1 parent cbc6fa0 commit ab9dc4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ${hookName} = ({ query, options } = {}) => {
if (res?.error) {
throw new Error(res.error);
}
return res;
return res ?? undefined;
}),
options
);
Expand Down Expand Up @@ -114,7 +114,7 @@ export const ${hookName} = ({
if (res?.error) {
throw new Error(res.error);
}
return res;
return res ?? undefined;
}),
options
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prisma-hooks",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"description": "100% type-safe, generated react-query hooks for quering any model in your prisma-managed database.",
"main": "index.js",
Expand Down

0 comments on commit ab9dc4f

Please sign in to comment.