Skip to content

Commit

Permalink
fix: unset optional on non-nullable relation
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha authored Mar 14, 2023
1 parent a44f2df commit 4e332cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/generateTypes/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function generateTsTypes(
if (field.meta?.interface?.startsWith("presentation-")) return;
ret += " ";
ret += field.field.includes("-") ? `"${field.field}"` : field.field;
if (field.relation || field.schema?.is_nullable) ret += "?";
if (field.relation) ret += "?";
ret += ": ";
ret += getType(field, useIntersectionTypes);
ret += ";\n";
Expand Down

0 comments on commit 4e332cb

Please sign in to comment.