Learning about GraphQL. Happy learning
To fetch dependencies
npm install
Start GraphQL server
npm run start
Browse to http://localhost:4000/graphql
To create a message
mutation {
createMessage(input: {
content: "first message"
author: "Tuan"
}) {
id
content
author
}
}
To update a message
mutation {
updateMessage(id: "71ae8ac3b634f3835e1a", input: {
content: "updated message"
author: "Tuan Phan"
}){
id
}
}
To get a message
{
getMessage(id: "71ae8ac3b634f3835e1a"){
id
content
author
}
}