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

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.

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
```