Skip to main content

Function: categoryService()

categoryService(client): object

Defined in: service/CategoryService.ts:56

Service class for Category-related GraphQL operations

Parameters

client

GraphQLClient

Returns

addProductsClustersToCategory()

addProductsClustersToCategory(variables): Promise<CategoryAddProductsClustersResponse>

Adds products/clusters to a category *

Parameters

variables

CategoryAddProductsClustersVariables

Category add products/clusters input data *

Returns

Promise<CategoryAddProductsClustersResponse>

Promise<Category> The updated category

createCategory()

createCategory(variables): Promise&lt;Category>

Creates a new category *

Parameters

variables

CategoryCreateVariables

Category creation input data *

Returns

Promise&lt;Category>

Promise<Category> The created category

getAttributeResultByCategoryId()

getAttributeResultByCategoryId(categoryId, input): Promise&lt;AttributeResultResponse>

Fetches attribute results for a category *

Parameters

categoryId

number

Category ID *

input

AttributeResultSearchInput

Attribute result search input *

Returns

Promise&lt;AttributeResultResponse>

Promise<AttributeResultResponse> The attribute result response

getCategories()

getCategories(filter?, userId?): Promise&lt;CategoryResponse>

Fetches a list of categories *

Parameters

filter?

any

Category filter criteria *

userId?

number

User ID for personalization *

Returns

Promise&lt;CategoryResponse>

Promise<Category[]> Array of categories

getCategory()

getCategory(variables, fetchOptions?): Promise&lt;Category>

Fetches a single category by ID or slug *

Parameters

variables

CategoryQueryVariables

Variables for the category query

    • categoryId: number - Category ID to fetch
    • slug: string - Category slug to fetch
    • userId: number - User ID for personalization
    • hidden: boolean - Whether to include hidden categories
    • language: string - Language for localized content
    • priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
    • categoryProductSearchInput: CategoryProductSearchInput - Category product search input
    • imageSearchFilters: MediaImageProductSearchInput - Image search filters
    • imageVariantFilters: TransformationsInput! - Image transformation filters
    • filterAvailableAttributeInput: FilterAvailableAttributeInput - Filter available attributes
fetchOptions?

GraphQLFetchOptions

Returns

Promise&lt;Category>

Promise<Category> The category data

importCategoriesCsv()

importCategoriesCsv(input): Promise&lt;CsvImportResponse>

Imports categories from CSV *

Parameters

input

CategoryCsvInput

CSV import input data *

Returns

Promise&lt;CsvImportResponse>

Promise<CsvImportResponse> The import response

removeProductsClustersFromCategory()

removeProductsClustersFromCategory(variables): Promise&lt;CategoryRemoveProductsClustersResponse>

Removes products/clusters from a category *

Parameters

variables

CategoryRemoveProductsClustersVariables

Category remove products/clusters input data *

Returns

Promise&lt;CategoryRemoveProductsClustersResponse>

Promise<Category> The updated category

updateCategory()

updateCategory(variables): Promise&lt;Category>

Updates an existing category *

Parameters

variables

CategoryUpdateVariables

Category update input data *

Returns

Promise&lt;Category>

Promise<Category> The updated category