GetFacetParams
Parameters for the getFacet API endpoint
interface GetFacetParams extends Partial<{
category: {
limit?: number;
offset?: number;
sort?: string;
};
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;
}>, Pick<RequestVariables, "country" | "currency" | "customerGroupId" | "locale"> {
category: {
limit?: number;
offset?: number;
sort?: string;
};
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 | { limit?: number; offset?: number; sort?: string; } | 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? |