Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix sending duplicate products to the client, assigned to multiple category hierarchies

ridiazf7df31016d86
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index 15b1b5c205..d605634d4f 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -123,7 +123,7 @@ class CategoryType(DjangoObjectType):
tree = self.get_descendants(include_self=True)
qs = products_for_api(context.user)
- qs = qs.filter(categories__in=tree)
+ qs = qs.filter(categories__in=tree).distinct()
attributes_filter = args.get('attributes')
order_by = args.get('order_by')
price_lte = args.get('price_lte')