The Todo App demonstrates how to use WunderGraph with Next.js & PostgreSQL.
Key features of the App are:
- Create, read, update, delete todos
- Mark todos as complete
- Reorder todos
- Optimistic updates
- Copy the
.env.example
file to.env
and fill in the required values. - Install the dependencies and run the complete example in one command:
npm install && npm start
After a while, a new browser tab will open, If no tab is open, navigate to http://localhost:3000.
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.
Change the schema.prisma
file and run npm run migrate %your_migration_name%
,
e.g. npm run migrate "add pets"
.
npm run cleanup
Read the Docs.
Join us on Discord!