This a simple Go CRUD example using GraphQL
Implement create, read, update and delete on Go.
To run the program:
- docker-compose up --build
- docker exec -it golang_app bash
- go run main.go
- docker exec -it golang_app bash -c "go run main.go"
- Run the example:
go run main.go
http://localhost:8080/document?query=mutation+_{create(name:"Document",file:"2021-01-13-00-00-skfnsk82y4fbusnfkisn"){id,name,file}}
- Get single document by id:
http://localhost:8080/document?query={document(id:1){name,file}}
- Get document list:
http://localhost:8080/document?query={list{id,name,file}}
http://localhost:8080/document?query=mutation+_{update(id:1,price:3.95){id,name,file}}
http://localhost:8080/document?query=mutation+_{delete(id:1){id,name,file}}