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
I'm working on integrating this generator into our workflow, we've been looking for something just like this.
I've run into one small problem that I can't figure out: correctly generating types from models that have compound @@unique elements referring to multiple model fields. For example:
model ProductVariant {
productId Int
name String
url String
imageUrl String
price Float
product Product @relation(fields: [productId], references: [id])
@@unique([productId, name]) <---- This element
}
After generation, I'll get an error on the "findUnique" definition for the ProductVariant type:
I'm specifically asking how to address this upstream of the code generation so that my team doesn't need to apply these fixes manually (there are about 13 different types that each have this same issue).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm working on integrating this generator into our workflow, we've been looking for something just like this.
I've run into one small problem that I can't figure out: correctly generating types from models that have compound @@unique elements referring to multiple model fields. For example:
After generation, I'll get an error on the "findUnique" definition for the ProductVariant type:
Any suggestions to get around this issue? Much appreciated!
EDIT: I should have mentioned, it's clear what the fix to
ProductVariantObject->findUnique
should be:I'm specifically asking how to address this upstream of the code generation so that my team doesn't need to apply these fixes manually (there are about 13 different types that each have this same issue).
Beta Was this translation helpful? Give feedback.
All reactions