Chat Demo
Getting started
- Install go modules & npm dependencies
go mod download
npm i
- Start server and start react client
chmod +x start-server.sh
./start-server.sh
npm run start
Example is forked from: gqlgen
Example(s)
mutation SendMessage {
post(roomName: "#test", username: "me", text: "hello!") {
...MessageData
}
}
query GetMessages {
room(name:"#test") {
name
messages {
...MessageData
}
}
}
subscription LiveMessages {
messageAdded(roomName: "#test") {
...MessageData
}
}
fragment MessageData on Message{
id
text
createdBy
createdAt
}