Resource: TraversyMedia series
- in terminal 1: run the server file
npm run dev - in terminal 2: run the json-server mock API
npm run json - visit
http://localhost:4000/graphql- Add query on the left side
- Click the play button
{
customer(id: "1"){
name,
email,
age
}
}
{
customers{
name,
email,
age
}
}
mutation{
addCustomer(name: "Willie Nelson", age: 89, email: "[email protected]"){
id, name, age, email
}
}
mutation{
deleteCustomer(id: "1"){
id
}
}
mutation{
editCustomer(id: "3", age: 44, email: "[email protected]"){
id, name, age, email
}
}