GraphQL Subscriptions with Go and gqlgen
- gvm Go 1.23
gvm install go1.23 --prefer-binary --with-build-tools --with-protobuf gvm use go1.23 --default
- gqlgen
- docker
- docker-compose
- nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash nvm install v22.1.0 nvm use nvm v22.1.0 cd ./frontend && pnpm install -g yarn
- curl
- jq
$ make
Usage: make COMMAND
Commands :
help - List available tasks
clean - Cleanup
generate - Generate GraphQL go source code
test - Run tests
build - Build GraphQL API
run - Run GraphQL API
image - Build Docker image
build-frontend - Build JS client frontend
run-frontend - Run JS client frontend
image-frontend - Build JS client Docker image
get - Download and install packages
deps - Download and install dependencies
release - Create and push a new tag. Modify `Version` field in `server.go` as it's used as an actual tag name
update - Update dependencies to latest versions
version - Print current version(tag)
redis-up - Start Redis
redis-down - Stop Redis
Start Redis
make redis-up
Run GraphQL API
make run
Run JS client frontend. Command below should open a browser at http://localhost:3000. Open another window at http://localhost:3000 post a message and see it appear in the other window.
make run-frontend