https://github.com/conorheffron/go-graph
This is a small application used track to do items using Go & the GraphQL Playground
https://github.com/conorheffron/go-graph
99designs go golang gqlgen graphiql-interface graphql
Last synced: 3 months ago
JSON representation
This is a small application used track to do items using Go & the GraphQL Playground
- Host: GitHub
- URL: https://github.com/conorheffron/go-graph
- Owner: conorheffron
- License: gpl-3.0
- Created: 2025-10-25T15:01:14.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-04-04T18:02:28.000Z (3 months ago)
- Last Synced: 2026-04-04T19:57:05.159Z (3 months ago)
- Topics: 99designs, go, golang, gqlgen, graphiql-interface, graphql
- Language: Go
- Homepage: https://conorheffron.github.io/go-graph/
- Size: 43.9 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-graph
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://github.com/conorheffron/go-graph/actions/workflows/go.yml)
## Overview
- Track to do items with Go & GraphQL.
### Quick start build steps
```shell
go install github.com/99designs/gqlgen@latest
go mod init go-graph
go get github.com/99designs/gqlgen@v0.17.89
go run github.com/99designs/gqlgen init
go mod tidy
go build .
./go-graph
```
### Should see the following in console:
```shell
2025/10/25 17:37:16 connect to http://localhost:8080/ for GraphQL playground
```
### Start Server (without Build Steps)
```shell
go run ./server.go
```
### Go to GraphiQL UI
- http://localhost:8080/
### Sample Mutations & Query (GraphQL format)
```graphql
query myToDos {
todos {
id
text
done
}
}
mutation addToDo {
createTodo(text: "Learn GraphQL") {
id
text
done
}
}
mutation addToDo2 {
createTodo(text: "Shopping") {
id
text
done
}
}
mutation addToDo3 {
createTodo(text: "Exercise") {
id
text
done
}
}
```
### Sample Mutations & Query (curl format)
#### Muation (Add 'Learn GraphQL' to do)
```shell
curl -X POST -H "Content-Type: application/json" \
-d '{"query": "mutation { createTodo(text: \"Learn GraphQL\") { id text done } }"}' \
http://localhost:8080/query
```
#### Response
```json
{"data":{"createTodo":{"id":"8053753236064475949","text":"Learn GraphQL","done":false}}}
```
#### Muation (Add 'Shopping' to do)
```shell
curl -X POST -H "Content-Type: application/json" \
-d '{"query": "mutation { createTodo(text: \"Shopping\") { id text done } }"}' \
http://localhost:8080/query
```
#### Response
```json
{"data":{"createTodo":{"id":"3260314713893700176","text":"Shopping","done":false}}}
```
#### Query (Get TODOs list)
```shell
curl -X POST -H "Content-Type: application/json" \
-d '{"query": "query { todos { id text done } }"}' \
http://localhost:8080/query
```
#### Response
```json
{"data":{"todos":[{"id":"8053753236064475949","text":"Learn GraphQL","done":false},{"id":"3260314713893700176","text":"Shopping","done":false}]}}
```