You are reading the documentation for SDK v2, which is no longer the latest version. Switch to current
GetFacetParams
Parameters for the getFacet API endpoint
export interface GetFacetParams extends Partial<{
categorySlug: string;
rootCatSlug: string;
filters: {
[key: string]: string[];
};
sort: string;
phrase: string;
page: number;
perPage: number;
customParams: {
[key: string]: unknown;
};
category: {
sort?: string;
limit?: number;
offset?: number;
};
withVariants: boolean;
customQuery: Record<string, string>;
}>, Pick<RequestVariables, "locale" | "currency" | "country" | "customerGroupId"> {
category: {
sort?: string;
limit?: number;
offset?: number;
};
categorySlug: string;
customParams: {
[key: string]: unknown;
};
customQuery: Record<string, string>;
filters: {
[key: string]: string[];
};
page: number;
perPage: number;
phrase: string;
rootCatSlug: string;
sort: string;
withVariants: boolean;
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
category | Required | { sort?: string; limit?: number; offset?: number; } | Category results options |
categorySlug | Required | string | Slug of the category |
customParams | Required | { [key: string]: unknown; } | Custom GraphQL variables to pass to the query. |
customQuery | Required | Record<string, string> | Customization of the GraphQL query that's used to fetch the data. |
filters | Required | { [key: string]: string[]; } | List of facets to apply to the search. Each key can be either category or a facet name defined in the api-client config file integrations.ct.configuration.faceting.availableFacets |
page | Required | number | Page number |
perPage | Required | number | Determines how many products should be returned in a single page. |
phrase | Required | string | Phrase to search by |
rootCatSlug | Required | string | |
sort | Required | string | Sorting option. A valid option is an id of sortingOptions from the api client config. |
withVariants | Required | boolean | Should results include products variants? |