https://github.com/danielres/apollo-prisma-nexus
This repo is to test and build skills with Prisma (prisma2) which focuses on code first approach and also becoming more familiar with prisma-nexus instead of prisma-binding.
https://github.com/danielres/apollo-prisma-nexus
Last synced: 11 months ago
JSON representation
This repo is to test and build skills with Prisma (prisma2) which focuses on code first approach and also becoming more familiar with prisma-nexus instead of prisma-binding.
- Host: GitHub
- URL: https://github.com/danielres/apollo-prisma-nexus
- Owner: danielres
- Created: 2020-11-04T03:07:09.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-05T13:58:06.000Z (about 5 years ago)
- Last Synced: 2025-01-09T06:40:49.600Z (about 1 year ago)
- Language: TypeScript
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL Apollo Server
### 1. Start the GraphQL server
Launch your GraphQL server with this command:
```
npm run dev
```
API operations
## Evolving the app
Evolving the application typically requires four subsequent steps:
1. Migrating the database schema using SQL `npx prisma migrate save --experimental` and
`npx prisma migrate up --experimental`
2. Updating your Prisma schema by introspecting the database with `prisma introspect`
3. Generating Prisma Client to match the new database schema with `prisma generate`
4. Using the updated Prisma Client in your application code
### 2. Introspect your database
```
npx prisma introspect
```
With the updated Prisma schema, you can now also update the Prisma Client API with the following command:
### 3. Generate a datamodel from the database
```
npx prisma generate
```
### 4. Migrate the database with new Datamodel
This saves the migration to the folder structure
```
npx prisma migrate save --experimental
```
This deploys the migration to the database and adds it to the migration table there
```
npx prisma migrate up --experimental
```