Function: productService()
productService(
client):object
Defined in: service/ProductService.ts:90
Service class for Product-related GraphQL operations
Parameters
client
Returns
addSurchargesToProduct()
addSurchargesToProduct(
input):Promise<ConfirmationResponse>
Adds surcharges to a product *
Parameters
input
Surcharges input data *
Returns
Promise<ConfirmationResponse>
Promise<boolean> Success status
createProduct()
createProduct(
input):Promise<Product>
Creates a new product *
Parameters
input
Product creation input data *
Returns
Promise<Product>
Promise<Product> The created product
getAttributeResultByProductId()
getAttributeResultByProductId(
productId,input):Promise<AttributeResultResponse>
Fetches attribute results for a product *
Parameters
productId
number
Product ID *
input
Attribute result search input *
Returns
Promise<AttributeResultResponse>
Promise<AttributeResultResponse> The attribute result response
getAttributesByProductId()
getAttributesByProductId(
productId,input):Promise<AttributeResponse>
Fetches attributes for a product *
Parameters
productId
number
Product ID *
input
Attribute search input *
Returns
Promise<AttributeResponse>
Promise<AttributeResponse> The attributes response
getProduct()
getProduct(
variables,fetchOptions?):Promise<Product>
Fetches a single product by ID, slug, or SKU *
Parameters
variables
input variables for aproduct to fetch
-
- productId: int - Product ID to fetch
-
- slug: string - Product slug to fetch
-
- sku: string - Product SKU to fetch
-
- language: string - Language for localized content
-
- applyOrderlists: boolean - Whether to apply orderlist logic
-
- orderlistIds: number[] - Array of orderlist IDs to apply
-
- 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?
Returns
Promise<Product>
Promise<Product> The product data
getProducts()
getProducts(
variables):Promise<ProductsResponse>
Fetches a list of products with search criteria *
Parameters
variables
-
- input: ProductSearchInput - Product search input parameters
-
- language: string - Language for localized content
-
- priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
-
- imageSearchFilters: MediaImageProductSearchInput - Image search filters
-
- imageVariantFilters: TransformationsInput - Image transformation filters
-
- filterAvailableAttributeInput: FilterAvailableAttributeInput - Filter available attributes input
Returns
Promise<ProductsResponse>
Promise<ProductsResponse> The products response data
getProductSurcharges()
getProductSurcharges(
productId):Promise<SurchargeProductResponse>
Fetches surcharges for a product *
Parameters
productId
number
Product ID *
Returns
Promise<SurchargeProductResponse>
Promise<SurchargesResponse> The surcharges response
importProductsCsv()
importProductsCsv(
input):Promise<CsvImportResponse>
Imports products from CSV *
Parameters
input
CSV import input data *
Returns
Promise<CsvImportResponse>
Promise<CsvImportResponse> The import response
updateProduct()
updateProduct(
variables):Promise<Product>
Updates an existing product *
Parameters
variables
ProductUpdateVariables update input data
-
- productId: number - ID of the product to update
-
- input: UpdateProductInput - The fields to update for the product
Returns
Promise<Product>
Promise<Product> The updated product