findCategories
Method finding categories in Bloomreach Discovery.
This method sends a GET request to the search endpoint of the Vue Storefront API Middleware. In turn, it receives data from the Bloomreach GraphQL Commerce API using findCategories query.
You can use this method to fetch information about categories.
Signature
declare function findCategories(
params?: QueryParams<QueryFindCategoriesArgs>
): Promise<Category[]>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
params | Optional | QueryParams<QueryFindCategoriesArgs> | Check the type for more information. |
Returns
Returns an array of categories.
Referenced Types
Examples
Fetching categories.
import { sdk } from '~/sdk';
const categories = await sdk.brs.findCategories();Fetching categories with only specified fields.
import { sdk } from '~/sdk';
const categories = await sdk.brs.findCategories({
expect: `
displayName
id
`
});
@example
Fetching categories passing query hint.