Alokai

wishlistItemsCount

Count items in the wishlist

Signature

declare function wishlistItemsCount(
	context: Context,
	customHeaders?: CustomHeaders
): Promise<ApolloQueryResult<Customer>>;

Parameters

NameRequiredTypeDescription
contextRequiredContext
customHeadersOptionalCustomHeaders

Referenced Types

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.

On this page