In this project the graphql api method is applied for getting and posting data. Django is used for handling requests and Database handling.
To install this project
docker-compose build --no-cache
In order to run
docker-compose up
Also to stop it
docker-compose down -v
in order to see result data in graphql, some dummy data is populated with autofixture in entrypoin.sh with this command:
python manage.py loadtestdata buy.Orders:3000 buy.Products:2000 -d
So to see results follow: 0.0.0.0:8000/graphql
to get data put this as query and press > button. all dummy data is shown.
query{
allOrders {
id
totalPrice
deliveryMethod
}
allProducts{
category
id
name
}
}
for posting order data use this mutation
mutation{
addOrder(input:{deliveryMethod:"sdssdsdd", paymentMethod: "55sdsd"}){
order{
deliveryMethod
paymentMethod
products
quantities
totalPrice
}
}
}
and for posting product data:
mutation{
addProduct(input:{name:"randName",category:"sthiii",quantity:5}){
product{
name
category
quantity
}
}
}