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

prisma-generate-schema

Package Overview
Dependencies
Maintainers
1
Versions
474
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-generate-schema

Transform prisma datamodel SDL into graphql-js SDL

  • 1.18.0-beta.16
  • npm
  • Socket score

Version published
Weekly downloads
2.4K
decreased by-58.12%
Maintainers
1
Weekly downloads
 
Created
Source

prisma-generate-schema

This module is capable of generating a prisma OpenCRUD schema for a given datamodel, given in SDL.

Developing

Development uses typescript, npm, yarn and jest.

yarn
npm run test

Usage

Basic Usage:

import { generateCRUDSchemaString } from 'prisma-generate-schema'

const openCRUDSchema = generateCRUDSchemaString(modelInSDL)

Project Structure

This section is intended for maintainers.

First, a datamodel is parsed using the DatamodelParser. Then, an OpenCRUD schema is created using the SchemaGenerator.

The schema generator utilizes several other generators to generate the mutation, query and subscription objects and all corresponding types. A Generator is usually responsible for a single type only but will access other generators to recursively build the schema. All generators which return object types implement lazy evaluation and caching of generated types via their base class. The generators can be configured using dependency injection, if needed, to switch out the implementation for certain types in the schema. All default generators, one for each type that can occur in an OpenCRUD schema, can ge found in the DefaultGenerators class.

FAQs

Package last updated on 05 Oct 2018

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