Skip to content

This projects is build with Django and using Graphql for routing.

Notifications You must be signed in to change notification settings

arezamoosavi/shopping-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shopping app with Qraphql

In this project the graphql api method is applied for getting and posting data. Django is used for handling requests and Database handling.

Installation

To install this project

docker-compose build --no-cache

In order to run

docker-compose up

Also to stop it

docker-compose down -v

Usage

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
    }
  }
}

About

This projects is build with Django and using Graphql for routing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published