Parameters
-
apiOptions: NullableParameters<{
headers?: {
[key: string]: string;
};
parameters: { id: string; levels?: number | undefined; organizationId?: string | undefined; locale?: string | undefined; siteId?: string | undefined; };
}>
-
queryOptions: ApiQueryOptions<{
(options?): Promise<Category>;
<T>(options?, rawResponse?): Promise<T extends true
? Response
: Category>;
}> = {}
A TanStack Query query hook with data from the Shopper Products getCategory
endpoint.
When you use the URL template below, the server returns a category identified by its ID; by default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. The server only returns online categories.
Parameter
apiOptions - Options to pass through to
commerce-sdk-isomorphic
, withnull
accepted for unset API parameters.Parameter
queryOptions - TanStack Query query options, with
enabled
by default set to check that all required API parameters have been set.See
commerce-sdk-isomorphic
documentation for more information on the parameters and returned data type.useQuery
reference for more information about the return value.