NobodyButMe-Haiya / graphql-crud

Graph QL + Apollo + MySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

###Experiment Purpose Apollo + GraphQL + MySQL

For install in the folder

yarn add sequelize-auto sequelize-cli mysql -g apollo-server graphql sequelize mysql2 nodemon

npx sequelize init:config

npx sequelize init:models

npx sequelize-auto -o models -d youtuber -h localhost -u youtuber -p 3306 -x 123456 -e mysql

For Database

  1. It's the same with : https://github.com/NobodyButMe-Haiya/React-App-2022/blob/master/youtuber.sql

  2. Find All Record

{
    getPersons {
        name,
        age,
        personId
     }
}
  1. Find All By Id
{
    getPerson(personId:4) {
        name,
        age,
        personId
     }
}
  1. Create
mutation{
  createPerson(
    name:"Jane Doe",
    age:14
  )
}
  1. update
mutation{
  updatePerson(
    personId:14,
    name:"Cat",
    age:13
  )
}
  1. Delete Record
mutation{
  deletePerson(
    personId:13
  ) 
}

About

Graph QL + Apollo + MySQL


Languages

Language:JavaScript 100.0%