File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 22
33Transforms prisma schema into graphql schema
44
5+ ## Install
6+ ``` bash
7+ npm i prisma-generator-graphql-typedef
8+ ```
9+
510## Example
611This prisma schema:
712``` bash
Original file line number Diff line number Diff line change 1+ # prisma-generator-graphql-typedef
2+
3+ Transforms prisma schema into graphql schema
4+
5+ ## Install
6+ ``` bash
7+ npm i prisma-generator-graphql-typedef
8+ ```
9+
10+ ## Example
11+ This prisma schema:
12+ ``` bash
13+ model User {
14+ id Int @id @default(autoincrement ())
15+ createdAt DateTime @default(now ())
16+ updatedAt DateTime @updatedAt
17+ /// @gqlIgnore
18+ password String
19+ email String @unique
20+ name String?
21+ posts Post[]
22+ profile Profile?
23+ /// user role
24+ role Role @default(USER)
25+ }
26+ ```
27+ Will generate this graphql schema:
28+ ``` bash
29+ type User {
30+ id: Int
31+ createdAt: DateTime
32+ updatedAt: DateTime
33+ email: String
34+ name: String
35+ posts: Post[]
36+ profile: Profile
37+ role: Role
38+ }
39+ ```
40+
41+ > This generator was bootstraped using [ create-prisma-generator] ( https://github.com/YassinEldeeb/create-prisma-generator )
You can’t perform that action at this time.
0 commit comments