An open API service indexing awesome lists of open source software.

https://github.com/jcserv/prisma-graphql-api-template

This template can be used to quickly setup a GraphQL API, using Prisma/Typescript/Apollo/Pothos/Relay
https://github.com/jcserv/prisma-graphql-api-template

apollo codegen graphql node postgres pothos prisma typescript

Last synced: about 2 months ago
JSON representation

This template can be used to quickly setup a GraphQL API, using Prisma/Typescript/Apollo/Pothos/Relay

Awesome Lists containing this project

README

        

# prisma-graphql-api-template

![visitors](https://img.shields.io/endpoint?url=https://vu-mi.com/api/v1/views?id=jcserv/prisma-graphql-api-template)

this template can be used to quickly setup a prisma + graphql + typescipt project,
with all the required configuration out of the box.

## features

- ๐Ÿ’  prisma orm, apollo server, pothos, relay
- ๐ŸŒ€ end-to-end type safety via code generation (prisma -> pothos)
- ๐Ÿ“‘ automagical pagination support via relay
- ๐Ÿ“ฆ automatic query optimization to solve n+1 problem (provided via [prisma](https://pothos-graphql.dev/docs/plugins/prisma/connections))
- ๐Ÿงช unit/e2e tests setup
- ๐Ÿš€ dev workflow tools galore (vscode, husky, eslint, prettier, etc)
- โœ… continuous integration with github workflows

## installation

### prerequisites

- [node.js](https://nodejs.org/en)
- [pnpm](https://pnpm.io/installation)
- [docker](https://docs.docker.com/get-started/get-docker/)

### using this template

1. create a Github repository, using this template
2. replace all instances of "prisma-graphql-api-template" with ""
3. initialize your .env file (see .env.example)
4. go to your github repo settings and add the following secrets:
- DATABASE_URL
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB

### running locally

1. clone this repo
2. run `pnpm i`
3. run `pnpm dev:db`
4. run `pnpm dev`
5. visit http://localhost:4000/graphql in your browser

### running tests

1. run `pnpm test:db:down`
2. run `pnpm test:db`
3. run `pnpm test`