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
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?
The text was updated successfully, but these errors were encountered:
And in the near feature - when Prisma SDK will be ready - the typegraphql-prisma integration will also allow to use a code-first approach to build a schema.prisma and GraphQL schema at once, using classes with decorators as a single source of truth. Stay tuned! 馃挭
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 aUser
definition, which looks like below:And also in
user.model
we define the same 'shape' but with typescript:Why is that necessary? Can't we somehow generate schema from models, or other way around?
The text was updated successfully, but these errors were encountered: