-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementImproving some features or writting testsImproving some features or writting testsgood first issueAlways wanted to get involved in an open source project but don’t know where to begin? Welcome!Always wanted to get involved in an open source project but don’t know where to begin? Welcome!help wantedExtra attention is neededExtra attention is needed
Description
Bug description
Write tests for making sure the models & enums output are generated correctly
Understanding the Feature
- specify a sample prisma definitions in the
schema.prisma
file like the following
generator client {
provider = "prisma-client-js"
}
generator PrismaTypeGraphQLTypesGenerator {
provider = "npx prisma-typegraphql-types-generator"
modelsOutput = "./src/models"
enumsOutput = "./src/types/enums"
useYarn = true
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
name String @db.VarChar(255)
// @nullable
email String @unique
// @skip
password String?
bio String? @db.VarChar(160)
// @skip
tokenVersion Int @default(0)
// @skip
confirmed Boolean @default(false)
profilePic String?
posts Post[]
githubId String? @unique
lastTimelineVisit DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Post {
id String @id @default(cuid())
title String
body String
tags String[]
published Boolean @default(false)
// @skip
authorId String
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
readingTimeTxt String
readingTimeMin Float
coverImg String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
check if It has generated the files and folders based on the specified output location
.
├── ...
├── src
│ ├── models
│ ├── Post.ts
│ └── User.ts
└── ...
Metadata
Metadata
Assignees
Labels
enhancementImproving some features or writting testsImproving some features or writting testsgood first issueAlways wanted to get involved in an open source project but don’t know where to begin? Welcome!Always wanted to get involved in an open source project but don’t know where to begin? Welcome!help wantedExtra attention is neededExtra attention is needed