wishlistItemsCount
Count items in the wishlist
Signature
declare function wishlistItemsCount(
context: Context,
customHeaders?: CustomHeaders
): Promise<ApolloQueryResult<Customer>>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | Context | |
customHeaders | Optional | CustomHeaders |
Referenced Types
- Context
- CustomHeaders
ApolloQueryResult- Customer
Examples
Simple usage:
import { sdk } from '~/sdk.config.ts';
// returns items counter of each wishlist for currently logged in customer
const response = await sdk.magento.wishlistItemsCount();
// response.data?.customer!.wishlists - array with object containing items counter.
// response.data?.customer!.wishlists[X]!.items_count - items_counter for each selected wishlist.
// index of element in the array isn't equal wishlist's id in the magento.