I have a content model "category" that contains products (also a content model). Now I have to get the category in which a product is linked. For this I got the product url_name (unique).
I searched in the kentico-delivery-sdk (JS) docs for a filter, that can go deeply inside an object/linked content model.
categoryByProduct: async (
_,
{ product, limit = 1,depth, order, language }
) => {
const query = deliveryClient.items();
language && query.languageParameter(getKcCodeFromLang(language));
limit && query.limitParameter(limit);
depth && query.depthParameter(depth);
order && query.orderParameter(order);
query.containsFilter("elements.produkte[].url_name", product)
const response = await query.getPromise();
return response.items;
},
With this approach I never get a response from GraphQL. Is this the wrong filter?