Food Resolver

Food

File Name: food.js

File Path: enatega-multivendor-api/graphql/resolvers/food.js

This Resolver is used to handle all food related queries such as fetching all the food items, fetching food item by category, creating food item, liking food item, liked food items, editing food items and deleting food items.

foods

  • GraphQL Type: Query

  • Input Type or Parameters: NULL

  • Description: Gets all the food items

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

foodByCategory

  • GraphQL Type: Query

  • Input Type or Parameters String!

  • Description: Gets all the food items for category id.

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

createFood

  • GraphQL Type: Mutation

  • Input Type or Parameters FoodInput!

  • Description: Creates a food item with the following parameters, variations of a food is for example small, medium, large

  • Response Input Type or Response: Food!

likeFood

  • GraphQL Type: Query

  • Input Type or Parameters FoodInput!

  • Description: Likes the food with id.

  • Response Input Type or Response: Food!

likedFood

  • GraphQL Type: Query

  • Input Type or Parameters NULL

  • Description: Returns all liked food by user

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

editFood

  • GraphQL Type: Mutation

  • Input Type or Parameters: FoodInput

  • Description: Gets all the food items for category id.

  • Response Input Type or Response: Food!

deleteFood

  • GraphQL Type: Mutation

  • Input Type or Parameters String!

  • Description: Deletes the food item with the id.

  • Response Input Type or Response: Food!

Last updated