Skip to main content

Function: clusterService()

clusterService(client): object

Defined in: service/ClusterService.ts:43

Service class for Cluster-related GraphQL operations

Parameters​

client​

GraphQLClient

Returns​

clusterAddToCategory()​

clusterAddToCategory(variables): Promise<BaseProductCategoryRelationship>

clusterAddToCategory operation

Parameters​

variables​

ClusterAddToCategoryVariables

Returns​

Promise<BaseProductCategoryRelationship>

clusterAssignProduct()​

clusterAssignProduct(variables): Promise<Cluster>

Attach a single existing product to a cluster. The product will be detached from a category or another cluster.

Parameters​

variables​

ClusterAssignProductVariables

Returns​

Promise<Cluster>

clusterCategoryMoveAbove()​

clusterCategoryMoveAbove(variables): Promise<BaseProductCategoryRelationship[]>

Reorder a cluster within its category so it appears immediately before another cluster.

Parameters​

variables​

ClusterCategoryMoveAboveVariables

Returns​

Promise<BaseProductCategoryRelationship[]>

clusterCategoryMoveBelow()​

clusterCategoryMoveBelow(variables): Promise<BaseProductCategoryRelationship[]>

Reorder a cluster within its category so it appears immediately after another cluster.

Parameters​

variables​

ClusterCategoryMoveBelowVariables

Returns​

Promise<BaseProductCategoryRelationship[]>

clusterRemoveFromCategory()​

clusterRemoveFromCategory(variables): Promise<boolean>

clusterRemoveFromCategory operation

Parameters​

variables​

ClusterRemoveFromCategoryVariables

Returns​

Promise<boolean>

clustersBulkAddToCategory()​

clustersBulkAddToCategory(variables): Promise<BaseProductCategoryRelationship[]>

clustersBulkAddToCategory operation

Parameters​

variables​

ClustersBulkAddToCategoryVariables

Returns​

Promise<BaseProductCategoryRelationship[]>

clustersBulkRemoveFromCategory()​

clustersBulkRemoveFromCategory(variables): Promise<boolean>

clustersBulkRemoveFromCategory operation

Parameters​

variables​

ClustersBulkRemoveFromCategoryVariables

Returns​

Promise<boolean>

clusterSetDefaultCategory()​

clusterSetDefaultCategory(variables): Promise<Cluster>

clusterSetDefaultCategory operation

Parameters​

variables​

ClusterSetDefaultCategoryVariables

Returns​

Promise<Cluster>

clusterUnassignProduct()​

clusterUnassignProduct(variables): Promise<Cluster>

Detach a single product from its current cluster.

Parameters​

variables​

ClusterUnassignProductVariables

Returns​

Promise<Cluster>

createCluster()​

createCluster(variables): Promise<Cluster>

Creates a new cluster *

Parameters​

variables​

ClusterCreateVariables

Cluster creation variables *

Returns​

Promise<Cluster>

Promise<Cluster> The created cluster

deleteCluster()​

deleteCluster(variables): Promise&lt;boolean>

Deletes a cluster *

Parameters​

variables​

ClusterDeleteVariables

Cluster delete variables *

Returns​

Promise&lt;boolean>

Promise<boolean> Success status

getCluster()​

getCluster(variables, fetchOptions?): Promise&lt;Cluster>

Fetches a single cluster by ID or slug *

Parameters​

variables​

ClusterVariables

Variables for cluster query

    • clusterId: number - Cluster ID to fetch
    • slug: string - Cluster slug to fetch
    • language: string - Language for localized content
    • priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
    • userBulkPriceProductInput: UserBulkPriceProductInput - User bulk price input
    • attributeResultSearchInput: AttributeResultSearchInput - Attribute search input
    • imageSearchFilters: MediaImageProductSearchInput - Image search filters
    • mediaVideoSearchInput: MediaVideoProductSearchInput - Video search input
    • mediaDocumentSearchInput: MediaDocumentProductSearchInput - Document search input
    • imageVariantFilters: TransformationsInput - Image transformation filters
fetchOptions?​

GraphQLFetchOptions

Returns​

Promise&lt;Cluster>

Promise<Cluster> Cluster data

getClusterConfig()​

getClusterConfig(clusterId, fetchOptions?): Promise&lt;Cluster>

Retrieves a specific cluster configuration *

Parameters​

clusterId​

number

Cluster ID to fetch *

fetchOptions?​

GraphQLFetchOptions

Returns​

Promise&lt;Cluster>

Promise<Cluster> Cluster config data

getClusters()​

getClusters(variables): Promise&lt;ClustersResponse>

Search the catalogue for clusters matching the supplied criteria.

Parameters​

variables​

ClustersVariables

Returns​

Promise&lt;ClustersResponse>

updateCluster()​

updateCluster(variables): Promise&lt;Cluster>

Updates an existing cluster *

Parameters​

variables​

ClusterUpdateVariables

Cluster update variables *

Returns​

Promise&lt;Cluster>

Promise<Cluster> The updated cluster