Alokai
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

NameRequiredTypeDescription
categoryRequired{ sort?: string; limit?: number; offset?: number; }Category results options
categorySlugRequiredstringSlug of the category
customParamsRequired{ [key: string]: unknown; }Custom GraphQL variables to pass to the query.
customQueryRequiredRecord<string, string>Customization of the GraphQL query that's used to fetch the data.
filtersRequired{ [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
pageRequirednumberPage number
perPageRequirednumberDetermines how many products should be returned in a single page.
phraseRequiredstringPhrase to search by
rootCatSlugRequiredstring
sortRequiredstringSorting option. A valid option is an id of sortingOptions from the api client config.
withVariantsRequiredbooleanShould results include products variants?

Referenced Types

On this page