getProductsWithFilter
Fetches product data by applying filters.
This method sends a GET request to the getProductsWithFilter endpoint of the Vue Storefront API Middleware. In turn, it receives data from the BigCommerce getProductsWithFilter GraphQL API.
Signature
declare function getProductsWithFilter(
props: GetProductsWithFilterParameters,
options?: MethodOptions
): Promise<ProductsResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | GetProductsWithFilterParameters | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions |
Returns
Returns a response with the products data
Referenced Types
Examples
Fetch products by applying a filter. Sending it this way, the response can be cached safely.
import { sdk } from '~/sdk.config.ts';
const products = await sdk.bigcommerce.getProductsWithFilter({
filters: {
searchTerm: 'cup'
}
})