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.
yarn database
yarn migrate init
yarn wundergraph
yarn dev
- Make changes to schema.prisma
- Run the migrations script
- Restart WunderGraph
All "model" descriptors in schema.prisma
must start with a lowercase letter.
yarn migrate "your migration name"
Examples:
yarn migrate "init"
yarn migrate "add users"
yarn migrate "add posts"
docker-compose rm -v -f
Read the Docs.
Join us on Discord!