Skip to content

Latest commit

 

History

History
86 lines (58 loc) · 1.48 KB

README.wunder.md

File metadata and controls

86 lines (58 loc) · 1.48 KB

WunderGraph Postgres Starter

Getting Started

Install the dependencies and run the example:

yarn global add @wundergraph/wunderctl@latest
yarn
yarn dev

To get started, first run the database. Once the DB is up and running, go ahead by running your first database migration (more info below). When the DB is migrated, start WunderGraph. Finally, run the NextJS application.

Running WunderGraph will automatically introspect the database and generate an API for you. You can add more Operations (e.g. Queries or Mutations) by adding more "*.graphql" files to the directory ./wundergraph/operations. Each file becomes an Operation. The Operation name is not relevant, the file name is.

1. Start the database

yarn database

2. Run your first migration

yarn migrate init

3. Start WunderGraph

yarn wundergraph

4. Start NextJS

yarn dev

Database Migrations workflow

  1. Make changes to schema.prisma
  2. Run the migrations script
  3. Restart WunderGraph

Important Note

All "model" descriptors in schema.prisma must start with a lowercase letter.

Running Migrations

yarn migrate "your migration name"

Examples:

yarn migrate "init"
yarn migrate "add users"
yarn migrate "add posts"

Cleanup

docker-compose rm -v -f

Got Questions?

Read the Docs.

Join us on Discord!