Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@juanlatorre/graphql-schema-generator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@juanlatorre/graphql-schema-generator

Generate Graphql schema(SDL) from Prisma schema using Prisma generator.

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

GraphQL-Schema-Generator for Prisma

CI codecov

Generate GraphQL schema (SDL) from Prisma schema using a custom Prisma generator.

This is a fork for personal use, it allows to specify the SCHEMA FILE name.

Getting Started

  1. Install this package in your project using:
// pnpm, npm, or yarn
pnpm install @juanlatorre/graphql-schema-generator
  1. Add the generator to the schema.prisma:
generator graphql {
  provider = "gql-schema-generator"
  createCRUD = "true"
  # output = "./generated" This is default path.
  # customSchema = "schema.graphql" This is default file name.
}
  1. Run npx prisma generate to run the generator

  2. Check schema.graphql in ./prisma/generated 🎉

Custom Rules

You can apply custom rules to manipulate behavior. (Some use cases). See this for example.

Example dir structure

image

Example usage

generator graphql {
  provider = "gql-schema-generator"
  output   = "../src/schemas"
  createCRUD = "true"
  customRules = "../prisma/rules.ts"
}

Example rules code

Contributing

Any contributions are welcome. If you are interested, check out our guidelines.

Keywords

FAQs

Package last updated on 25 May 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc