New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

prisma-generator-garph

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

prisma-generator-garph

Garph generator for prisma schema

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

prisma-generator-garph

Generate versatile garph schemes from your prisma schema.

This is still under development, expect bugs and breaks!

Currently does not support mongoDB composite types (https://www.prisma.io/docs/orm/prisma-schema/data-model/models#defining-composite-types)

Install it in your project,

npm i -D prisma-generator-garph
pnpm i -D prisma-generator-garph
bun i -D prisma-generator-garph

then add

generator garph {
  provider = "prisma-generator-garph"
  // you can optionally specify the output location. Defaults to ./garph
  output = "./myCoolGarphDirectory"
  // if you want, you can customize the imported variable name that is used for the schemes. Defaults to "g" which is what the standard garph package offers
  typeboxImportVariableName = "t"
  // you also can specify the dependency from which the above import should happen. This is useful if a package re-exports the typebox package and you would like to use that
  typeboxImportDependencyName = "garph"
}

to your prisma.schema. You can modify the settings to your liking, please see the respective comments for info on what the option does.

Annotations

prisma-generator-garph offers annotations to adjust the output of models and fields.

AnnotationExampleDescription
@garph.hide-Hides the field or model from the output
@garph.hidden-Alias for @garph.hide

A schema using annotations could look like this:

/// The post model
model Post {
  id        Int      @id @default(autoincrement())
  /// @garph.hidden
  createdAt DateTime @default(now())
  title     String   @unique

  User   User? @relation(fields: [userId], references: [id])
  /// this is the user id
  userId Int?
}

/// @garph.hidden
enum Account {
  PASSKEY
  PASSWORD
}

Please note that you cannot use multiple annotations in one line! Each needs to be in its own!

Keywords

prisma2

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts