The project is based on the guide from howtographql.com/graphql-go
Differences :
- It uses mongodb instead of mysql
- Login is setting the jwt token as cookie , no extra work required in the frontend
- Added logout mutation
go get
go run ./server.go
mutation {
createUser(input: {username: "user1", password: "123"})
}
mutation {
login(input: {username: "user1", password: "123"})
}
mutation {
logout(input: {info:true})
}
mutation {
createLink(input: {title: "real link!", address: "www.graphql.org"}){
user{
name
}
}
}
query {
links {
title
address
id
}
}