Enatega Multivendor
  • Introduction
  • High Level Architecture
  • Installation
    • How to deploy in local machine
    • How to deploy in production
    • How to Publish App
  • FAQS
  • License
  • ChangeLog
  • API SERVER
    • Introduction
    • Technologies
    • Packages Json
    • Outline
    • Model Diagram
    • Routes
    • Queries Mutations and Fragments
    • Resolvers
      • Order Resolver
      • Food Resolver
      • Configuration Resolver
      • Category Resolver
      • Auth Resolvers
  • ADMIN WEB DASHBOARD
    • Introduction
    • Technologies
    • Packages Json
    • Folder Structure
    • Customize
  • RIDER APP
    • Introduction
    • Folder Structure
    • Packages Json
    • Technologies Used
    • Guide
      • Customize
    • Components
  • CUSTOMER APP
    • Introduction
    • Folder Structure
    • Packages Json
    • Technologies Used
    • Guide
      • Customize
    • Components
  • RESTAURANT APP
    • Introduction
    • Folder Structure
    • Packages Json
    • Technologies Used
    • Guide
      • Customize
    • Components
  • CUSTOMER WEB
    • Introduction
    • Folder Structure
    • Package Json
    • Technologies Used
    • Components
  • Amplitude Dashboard
    • Introduction
    • Amplitude integration with Enatega Multivendor
  • Sentry Dashboard
    • Introduction
    • Sentry integration with Enatega Multivendor
  • CONFIGURATIONS
    • Google Maps API Keys
    • Push Notification Keys
    • Social Login
    • Configuring Cloudinary
    • Configuring Database
    • Configuring Payment Gateways
    • Server Configurations
Powered by GitBook
On this page
  • Food
  • foods
  • foodByCategory
  • createFood
  • likeFood
  • likedFood
  • editFood
  • deleteFood

Was this helpful?

  1. API SERVER
  2. Resolvers

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!]!

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

foodByCategory

  • GraphQL Type: Query

  • Input Type or Parameters String!

Name

Type

Required

category

String

true

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

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

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

createFood

  • GraphQL Type: Mutation

  • Input Type or Parameters FoodInput!

Name

Type

Required

_id

String

false

title

String

true

description

String

true

category

String

true

img_url

Upload

false

variations

[VariationInput!]!

true

  • 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!

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

likeFood

  • GraphQL Type: Query

  • Input Type or Parameters FoodInput!

Name

Type

Required

foodId

String

true

  • Description: Likes the food with id.

  • Response Input Type or Response: Food!

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

likedFood

  • GraphQL Type: Query

  • Input Type or Parameters NULL

  • Description: Returns all liked food by user

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

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

editFood

  • GraphQL Type: Mutation

  • Input Type or Parameters: FoodInput

Name

Type

Required

_id

String

false

title

String

true

description

String

true

category

String

true

img_url

Upload

false

variation

[VariationInput!]!

true

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

  • Response Input Type or Response: Food!

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

deleteFood

  • GraphQL Type: Mutation

  • Input Type or Parameters String!

Name

Type

Required

id

String

true

  • Description: Deletes the food item with the id.

  • Response Input Type or Response: Food!

Name

Type

_id

ID

title

String!

description

String!

variations

[Variations!]!

email

String

likes

Int

img_url

String!

liked

Boolean

is_active

Boolean!

PreviousOrder ResolverNextConfiguration Resolver

Last updated 4 years ago

Was this helpful?