Category Resolver
Category
File Name: category.js
File Path: food-delivery-api/graphql/resolvers/category.js
This Resolver is used for managing categories mainly for web dashboard use. CRUD operations are performed over here namely creating category, fetching categories, editing categories and deleting categories.
createCategory
GraphQL Type: Mutation
Input Type or Parameters: categoryInput
Description: Creates a category with img menu for the image for menu screen and img header for the menu items screen
Response Input Type or Response: Category!
categories
GraphQL Type: Query
Input Type or Parameters Not needed
Description: Fetches all the categories
Response Input Type or Response: [Category!]!
editCategory
GraphQL Type: Mutation
Input Type or Parameters: CategoryInput
Description: Edits category for given _id.
Response Input Type or Response: Category!
deleteCategory
GraphQL Type: Mutation
Input Type or Parameters: id
Description: Deletes Category for given id deleting doesn't delete it from database but only sets the is_active flag to false
Response Input Type or Response: Category!
Last updated