psina

Crates.iopsina
lib.rspsina
version0.1.7
sourcesrc
created_at2022-05-15 18:50:16.553507
updated_at2022-05-22 11:42:40.327733
descriptionBlazzzzingly fast graphql schema generator from prisma file
homepagehttps://github.com/GenrikhFetischev/psina
repository
max_upload_size
id587271
size22,518
Genrikh Fetischev (GenrikhFetischev)

documentation

README

PSINA 🐾

Blazzzzingly fast graphql schema generator from prisma file

All types from Prisma which are not represented in GraphQL scalars list (Int, Float, String, Boolean, and ID) will be added as scalar into graphql prisma file, for instance that:

enum UserRole {
    user
    admin
}

model User {
  id            BigInt    @id @map("user_id")
  externalId    String    @unique @map("external_id")
  name          String
  role          UserRole?
  description   String?
  pic           String?
  createdAt     DateTime
  tags          Strng[]
  
  @@index([externalId])
  @@map("user")
}

turns into the following:

# This file is generated by PSINA 🐾. Please, do not change it directly
# PSINA package: https://crates.io/crates/psina ⭐️

scalar Strng
scalar BigInt
scalar DateTime


enum UserRole {
    user
    admin
}

type User {
    id: BigInt!
    externalId: String!
    name: String!
    role: UserRole
    description: String
    pic: String
    createdAt: DateTime!
    tags: [Strng!]!
}

CLI

psina --prisma-file $PWD/schema.prisma --output-gql $PWD/schema.graphql
Commit count: 0

cargo fmt