Simple check out process with promo.
Query
product(sku: String!): Product!
allProducts(param: PagingQuery!): Products!
promo(sku: String!): Promo!
allActivePromo(param: PagingQuery!): Promos!
cartList(param: PagingQuery!): Carts!
checkout(input: CheckOutItem): ResponseCheckout!
Mutation
createProduct(input: NewProduct): Product!
createPromo(input: NewPromo): Promo!
updateProduct(input: NewProduct): Product!
updatePromo(input: NewPromo): Promo!
addCart(input: AddToCartItem!): Cart!
- direnv (optional)
make >= v4.1
you need this tool to use theMakefile
fswatch >= v1.11.2
if you want to use auto-compile-restart feature onMakefile
- golang 1.16.x
- docker / podman
- PostgreSQL >= 10
- First time only:
cp .envrc.sample .envrc
- Do your adjustment on
.envrc
, then
direnv allow .
do this each time you change value inside the .envrc
-
run
sql/create.sql
for generate database -
run server on
auto-reload mode
make serve
go run
make run
## Documentation
After running,
- GraphQL playground will `http://127.0.0.1:2727/v1/graphql`
- Endpoint will serve in `http://127.0.0.1:2727/v1/graphql/query`
All documentation for Query and Mutation will serve in GraphQL playground.
## Available Makefile Command
```bash
[!] Available Command:
-----------------------
app-image Create a docker image
compile Build binary version of application
compile_dev Compile dev version of application
lint Lint this codebase
run execute go run main.go
serve Run application and automaticaly restart on source code change