Implement list orders by REST, GRPC and GRAPHQL
docker-compose up -d
migrate -path=internal/infra/database/migrations -database "mysql://root:root@tcp(localhost:3306)/orders" -verbose up
go mod tidy
cd cmd/ordersystem
go run main.go wire_gen.go
The api rest run on port :8000
- Open api/create_order
- Send request
- Open api/list_orders
- Send request
The grpc server run on port :50051
evans -r repl
call ListOrders
The graphql server run on port :8080
- Go to http://localhost:8080/
- Add the query below
- Execute query
query listOrders {
orders {
id
Price
Tax
FinalPrice
}
}