Ecommero
  • Introduction
  • High Level Architecture
  • Installation
    • How to deploy in local machine
    • How to deploy in production
  • FAQS
  • License
  • ChangeLog
  • API SERVER
    • Introduction
    • Technologies
    • Packages Json
    • Outline
    • Model Diagram
    • Routes
    • Queries Mutations and Fragments
    • Resolvers
      • Auth Resolvers
      • User Resolvers
      • Configuration Resolver
      • Category Resolver
      • Sub Category Resolver
      • Product Resolver
  • ADMIN WEB DASHBOARD
    • Introduction
    • Technologies
    • Packages Json
    • Folder Structure
    • Components
    • Customize
  • CUSTOMER APP
    • Components
    • Introduction
    • Folder Structure
    • Packages Json
    • Technologies Used
    • Guide
      • Customize
Powered by GitBook
On this page
  • Category
  • createCategory
  • categories
  • editCategory
  • deleteCategory

Was this helpful?

  1. API SERVER
  2. Resolvers

Category Resolver

Category

File Name: category.js

File Path: shopping-cart-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

Name

Type

Required

_id

String

false

title

String

true

  • Description: Creates a category for menu screen and all main categories.

  • Response Input Type or Response: Category!

Name

Type

_id

ID

title

String

is_active

Boolean

categories

  • GraphQL Type: Query

  • Input Type or Parameters Not needed

  • Description: Fetches all the categories

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

Name

Type

_id

ID

title

String

is_active

String

editCategory

  • GraphQL Type: Mutation

  • Input Type or Parameters: CategoryInput

Name

Type

Required

_id

String

false

title

String

true

  • Description: Edits category for given _id.

  • Response Input Type or Response: Category!

Name

Type

_id

ID

title

String

is_active

String

deleteCategory

  • GraphQL Type: Mutation

  • Input Type or Parameters: id

Name

Type

Required

id

String

true

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

Name

Type

_id

ID

title

String

is_active

String

PreviousConfiguration ResolverNextSub Category Resolver

Last updated 4 years ago

Was this helpful?