This boilerplate is built using Golang, Chi and Gqlgen, providing a scalable and maintainable architecture to build your GraphQL API with ease.
To run this project, you will need to add the following environment variables to your .env file
APP_NAME
,APP_PORT
,APP_SECRET_KEY
,APP_SECRET_HEADER_NAME
,APP_DEBUG
,GQL_COMPLEXITY_LIMIT
Clone the project
git clone https://github.com/ugurkorkmaz/graphql-boilerplate
Go to the project directory
cd graphql-boilerplate
Run commands
go run ./bin all
Command | Description |
---|---|
build | Compiles the binary. |
install | Installs dependencies for the go.mod file. |
update | Updates project dependencies. |
gqlgen | Generates code from the GraphQL schema. |
frontend | Builds the frontend templates. |
run | Runs the binary. Prints the server URL and allows stopping it with Ctrl+C. |
test | Runs project tests and lints. |
clean | Removes the binary. |
all | Runs all the commands in order: gqlgen, update, build, and run. |
help | Shows available commands and their descriptions. |
Path | Description |
---|---|
/graphql |
Handles GraphQL requests and serves the GraphQL API. |
/websocket |
Handles WebSocket connections for real-time communication with the GraphQL API. |
/ |
Serves the Playground UI for interacting with the GraphQL API. |
Server: Go, Gqlgen, Chi
Contributions are always welcome!