- Register new customer
mutation { registerUser(customer: { name: "Rakesh Kumar", email: "rakeshpersonal@gmail.com", address:"New Delhi, India", password: "test@123" }) { id, name, email } }
- Login Registered User
mutation { login(customer: { email: "test@gmail.com", password:"test@123" }) }
- Get customers list
query { customers { name, id, email, address } }
- Get specific customer detail
query { ccustomer(id: "5ee4a83a6c001022ee618ea2") { name, email, } }
- Create new product
mutation { createNewProduct(product: { name: "iPhone", price: 100000, category: "mobile" }) { name, id, price, category } }
- Fetch list of products
query { products { category, price, name, id } }
- Create new Order
mutation { createNewOrder(order: { customerId: "5ee64df4dd50282d331f50eb", totalOrderValue: 12000, shippingAddress: "Gurgaon", paymentMethod: "COD", products: [ { productId: "5ee64e874f446934492e1389", quantity: 100, price: 12344 }, { productId: "5ee64e684f446934492e1388", quantity: 200, price: 543112 } ] }) { id, customerId, totalOrderValue, shippingAddress, paymentMethod, products { productId quantity, price, } } }
- Fetch list of orders
query { orders { shippingAddress, totalOrderValue, paymentMethod products { product { name, category, price } quantity, price } customer { name, email } } }