Dwipasca / nodejs-server-graphql

Learn how to create server with nodejs and graphql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodejs-server-graphql

Depp or Lib I use

  • nodemon
  • graphql
  • apollo-server
  • prisma
  • @prisma/client

How to use

  • clone this repo
  git clone git@github.com:Dwipasca/nodejs-server-graphql.git
  • go to the project directory
  cd nodejs-server-graphql
  • install depp
  npm i | npm install
  • migrate database sqlite with prisma
  npx prisma migrate dev
  • name your migrate, you can name it as "init" for the first time you clone this project

  • generate prisma client

  npx prisma generate
  • run project
  npm run dev
  • run prisma studio (optional) (show database)
  npx prisma studio

Manipulation file schema.prisma

  • after you add some model in file schema.prisma run this command
  npx prisma migrate dev --name "[name aaction model]"
  // for example
  npx prisma migrate dev --name "add-blog-model"
  • re-generate prisma client
  npx migrate generate

About

Learn how to create server with nodejs and graphql


Languages

Language:JavaScript 76.1%Language:Shell 23.9%