Prisma

Objective

  • A reference to piece together various technologies

Stack

  • NextJS

  • GraphQL Yoga

  • Pothos

  • Apollo Client

  • Prisma

  • PostgreSQL

  • AWS S3

  • Auth0

  • TypeScript

  • TailwindCSS

  • Vercel

Setup Prisma

Data Model

Generate Table

Seeding the database

create a new file /prisma/seed.ts

Install ts node

By default, Next.js forces the use of ESNext modules, we need to override this behavior or else we will not be able to execute the seeding script. To do so, first install ts-node as a development dependency:

Add the following in tsconfig.json

Update package json

Run seed data command

Update db

Reset Database

Inspect Records

References

  • https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-oklidw1rhw

Last updated