1.1.4 • Published 27 days ago

prisma-generator-graphql-typedef v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
27 days ago

This generator was bootstraped using create-prisma-generator

prisma-generator-graphql-typedef

Transforms prisma schema into graphql schema

Install

npm i prisma-generator-graphql-typedef

Example

This prisma schema:

model User {
  id        Int      @id @default(autoincrement())
  /// @gqlType Float
  createdAt DateTime @default(now())
  /// @gqlType Float
  updatedAt DateTime @updatedAt
  /// @gqlIgnore
  password  String 
  email     String   @unique
  name      String?
  posts     Post[]
  profile   Profile?
  /// user role
  role      Role     @default(USER)
}

Will generate this graphql schema:

password field is not included because of the @gqlIgnore keyword

createdAt and updatedAt fields' type was changed to Float by using @gqlType Float, which you can supply any type

type User {
  id: Int
  createdAt: Float
  updatedAt: Float
  email: String
  name: String
  posts: [Post]
  profile: Profile
  role: Role
}

This generator was bootstraped using create-prisma-generator

1.1.1

28 days ago

1.1.0

28 days ago

1.0.8

28 days ago

1.1.4

27 days ago

1.1.3

27 days ago

1.1.2

28 days ago

1.0.7

2 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago