https://github.com/prisma-korea/graphql-schema-generator
Generate GraphQL Schema from Prisma schema.
https://github.com/prisma-korea/graphql-schema-generator
Last synced: about 1 month ago
JSON representation
Generate GraphQL Schema from Prisma schema.
- Host: GitHub
- URL: https://github.com/prisma-korea/graphql-schema-generator
- Owner: prisma-korea
- License: mit
- Archived: true
- Created: 2021-12-14T09:57:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-14T04:54:54.000Z (over 3 years ago)
- Last Synced: 2025-03-25T02:51:32.364Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 259 KB
- Stars: 32
- Watchers: 3
- Forks: 13
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - prisma-korea/graphql-schema-generator - Generate GraphQL Schema from Prisma schema. (others)
README
# GraphQL-Schema-Generator for Prisma
[](https://github.com/prisma-korea/graphql-schema-generator/actions/workflows/ci.yml)
[](https://codecov.io/gh/prisma-korea/graphql-schema-generator)Generate **GraphQL schema (SDL)** from **Prisma schema** using a custom Prisma generator.
## Getting Started
1. Install this package in your project using:
```sh
// pnpm, npm, or yarn
pnpm install @prisma-korea/graphql-schema-generator
```2. Add the generator to the `schema.prisma`:
```prisma
generator graphql {
provider = "graphql-schema-generator"
createCRUD = "true"
# output = "./generated" This is default path.
}
```3. Run `npx prisma generate` to run the generator
4. Check `schema.graphql` in `./prisma/generated` 🎉
## Custom Rules
You can apply custom rules to manipulate behavior. [(Some use cases)](https://github.com/prisma-korea/graphql-schema-generator/issues/34). See [this](https://github.com/prisma-korea/graphql-schema-generator/tree/master/prisma) for example.> Example dir structure

> Example usage
```
generator graphql {
provider = "graphql-schema-generator"
output = "../src/schemas"
createCRUD = "true"
customRules = "../prisma/rules.ts"
}
```> Example [rules code](https://github.com/prisma-korea/graphql-schema-generator/issues/15#issuecomment-1012775364)
## Contributing
Any contributions are welcome. If you are interested, check out our [guidelines](https://github.com/prisma-korea/graphql-schema-generator/blob/master/CONTRIBUTING.md).