Home > @vue-storefront/magento-api > products

products() function

Fetches products using received search term and params for filter, sort and pagination.

Signature:

export default function products(context: Context, searchParams?: GetProductSearchParams, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<ApolloQueryResult<ProductsListQuery>>;

Parameters

Parameter Type Description
context Context VSF context
searchParams GetProductSearchParams (Optional) search term and params for filter, sort and pagination
customQuery CustomQuery (Optional) (optional) - custom GraphQL query that extends the default query
customHeaders CustomHeaders (Optional) (optional) - custom headers that extends the default headers

Returns:

Promise<ApolloQueryResult<ProductsListQuery>>