You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of my Prisma models have unique indexes which require conditional defaults based on the input. It seems like the defaultData function in prisma-fabbrica doesn't provide any info about the given input.
Ideally I'd like to do something like this:
constUserFactory=defineUserFactory({defaultData: async({input})=>{// This is the feature I want. To be able to set different defaults// based on what the given input is.if(input.type==='admin')return{permissions: '*'};return{permissions: null}}});
Describe the feature
Some of my Prisma models have unique indexes which require conditional defaults based on the input. It seems like the
defaultData
function inprisma-fabbrica
doesn't provide any info about the given input.Ideally I'd like to do something like this:
With that factory defined, I could then do this:
Is something like this possible with
prisma-fabbrica
today?I thought maybe Transient Fields would do this, but this limitation:
means that it doesn't work in my case.
The text was updated successfully, but these errors were encountered: