Order Resolver

Order

File Name: order.js

File Path: food-delivery-api/graphql/resolvers/order.js

This Resolver is used to handle all order related queries. For example getting a single order, getting all orders of the user, getting all order in the database, placing an order, editing an order, canceling an order, updating order status, giving rating and review to an order, getting all reviews of the user.

order

  • GraphQL Type: Query

  • Input Type or Parameters: String!

  • Description: Gets the order for particular id

  • Response Input Type or Response: Order!

orders

  • GraphQL Type: Query

  • Input Type or Parameters: NULL

  • Description: Gets the order of particular user

  • Response Input Type or Response: [Order!]!

allOrders

  • GraphQL Type: Query

  • Input Type or Parameters: NULL

  • Description: Gets the orders of all Users.

  • Response Input Type or Response: [Order!]!

placeOrders

  • GraphQL Type: Mutation

  • Input Type or Parameters: [OrderInput!]!, paymentMethod:String

  • Description: Gets all the orders of a particular User

  • Response Input Type or Response: Order!

editOrder

  • GraphQL Type: Mutation

  • Input Type or Parameters: _id:String! and [OrderInput!]!

  • Description: Edits Order of particular _id with given OrderInput parameters

  • Response Input Type or Response: Order!

cancelOrder

  • GraphQL Type: Mutation

  • Input Type or Parameters: OrderId:String!

  • Description: Sets the order status to cancel

  • Response Input Type or Response: Order!

updateOrderStatus

  • GraphQL Type: Mutation

  • Input Type or Parameters: orderId:String! and status:String!

  • Description: Changes the status of the order done from admin panel which sends a push notification to mobile app

  • Response Input Type or Response: Order!

reviewOrder

  • GraphQL Type: Mutation

  • Input Type or Parameters: reviewInput!

  • Description: Gives review to a order

  • Response Input Type or Response: Review!

reviews

  • GraphQL Type: Query

  • Input Type or Parameters: NULL

  • Description: Gets all the reviews of the user

  • Response Input Type or Response: [ReviewOutput!]!

Last updated