Open JiveOff opened 1 year ago
I ran into this same issue, but I found that I could simply make the arg's.join portion of the defaultValue be optional.
const defaultValue = field.default ? `${field.default.name}(${field.default.args?.join(', ')})` : '';
Hey @w3cj 👋
I encountered an error with the library and it might be related to a breaking change introduced by Prisma 5.
Permalink to genMermaid.ts on the repo.
After further investigation, the shape of the fields seem to change depending on their type. For instance, for a string field, you would get an object for the
default
property (like before), whereas Boolean fields get their default value as a boolean.In an attempt to fix, I edited the ternary condition to be
field.type !== 'Boolean' && field.default
and it worked as expected, but I am not sure if it is the right thing to do as I didn't find the appropriate information about generator-related breaking changes for Prisma 5.Can you have a look ? I can open a quick PR with that change if you want.
Thanks 😁