Food Resolver
Last updated
Last updated
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.
GraphQL Type: Query
Input Type or Parameters: NULL
Description: Gets all the food items
Response Input Type or Response: [Food!]!
GraphQL Type: Query
Input Type or Parameters String!
Description: Gets all the food items for category id.
Response Input Type or Response: [Food!]!
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!
GraphQL Type: Query
Input Type or Parameters FoodInput!
Description: Likes the food with id.
Response Input Type or Response: Food!
GraphQL Type: Query
Input Type or Parameters NULL
Description: Returns all liked food by user
Response Input Type or Response: [Food!]!
GraphQL Type: Mutation
Input Type or Parameters: FoodInput
Description: Gets all the food items for category id.
Response Input Type or Response: Food!
GraphQL Type: Mutation
Input Type or Parameters String!
Description: Deletes the food item with the id.
Response Input Type or Response: Food!
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
Required
category
String
true
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
Required
_id
String
false
title
String
true
description
String
true
category
String
true
img_url
Upload
false
variations
[VariationInput!]!
true
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
Required
foodId
String
true
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
Required
_id
String
false
title
String
true
description
String
true
category
String
true
img_url
Upload
false
variation
[VariationInput!]!
true
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!
Name
Type
Required
id
String
true
Name
Type
_id
ID
title
String!
description
String!
variations
[Variations!]!
String
likes
Int
img_url
String!
liked
Boolean
is_active
Boolean!