-
Notifications
You must be signed in to change notification settings - Fork 359
Closed
Description
Hi!
First of all thanks for this starter. It is really awesome π
I've noticed that some of the code is duplicated between prisma schema definitions and nest js models.
In prisma.schema we have a User definition, which looks like below:
model User {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @unique
password String
firstname String?
lastname String?
posts Post[]
role Role
}
And also in user.model we define the same 'shape' but with typescript:
@ObjectType()
export class User extends BaseModel {
email: string;
firstname?: string;
lastname?: string;
role: Role;
@HideField()
password: string;
}
Why is that necessary? Can't we somehow generate schema from models, or other way around?
marcjulian
Metadata
Metadata
Assignees
Labels
No labels