Skip to main content

Class: CategoryService

Defined in: service/CategoryService.ts:152

Backwards-compatible class form. New code should call categoryService(client).

Constructors

Constructor

new CategoryService(client): CategoryService

Defined in: service/CategoryService.ts:154

Parameters

client

GraphQLClient

Returns

CategoryService

Methods

addProductsClustersToCategory()

addProductsClustersToCategory(variables): Promise<CategoryAddProductsClustersResponse>

Defined in: service/CategoryService.ts:185

Adds products/clusters to a category

Parameters

variables

CategoryAddProductsClustersVariables

Category add products/clusters input data

Returns

Promise<CategoryAddProductsClustersResponse>


createCategory()

createCategory(variables): Promise<Category>

Defined in: service/CategoryService.ts:170

Creates a new category

Parameters

variables

CategoryCreateVariables

Category creation input data

Returns

Promise<Category>


getAttributeResultByCategoryId()

getAttributeResultByCategoryId(categoryId, input): Promise<AttributeResultResponse>

Defined in: service/CategoryService.ts:196

Fetches attribute results for a category

Parameters

categoryId

number

Category ID

input

AttributeResultSearchInput

Attribute result search input

Returns

Promise<AttributeResultResponse>


getCategories()

getCategories(filter?, userId?): Promise<CategoryResponse>

Defined in: service/CategoryService.ts:160

Fetches a list of categories

Parameters

filter?

any

Category filter criteria

userId?

number

User ID for personalization

Returns

Promise<CategoryResponse>


getCategory()

getCategory(variables, fetchOptions?): Promise<Category>

Defined in: service/CategoryService.ts:165

Fetches a single category by ID or slug

Parameters

variables

CategoryQueryVariables

Variables for the category query

fetchOptions?

GraphQLFetchOptions

Returns

Promise<Category>


importCategoriesCsv()

importCategoriesCsv(input): Promise<CsvImportResponse>

Defined in: service/CategoryService.ts:180

Imports categories from CSV

Parameters

input

CategoryCsvInput

CSV import input data

Returns

Promise<CsvImportResponse>


removeProductsClustersFromCategory()

removeProductsClustersFromCategory(variables): Promise<CategoryRemoveProductsClustersResponse>

Defined in: service/CategoryService.ts:190

Removes products/clusters from a category

Parameters

variables

CategoryRemoveProductsClustersVariables

Category remove products/clusters input data

Returns

Promise<CategoryRemoveProductsClustersResponse>


updateCategory()

updateCategory(variables): Promise<Category>

Defined in: service/CategoryService.ts:175

Updates an existing category

Parameters

variables

CategoryUpdateVariables

Category update input data

Returns

Promise<Category>