Skip to content

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

Remove unused connection with count

Marcin Gębala43b583ad5198
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index 170e26ba8f..e59b600259 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -65,9 +65,6 @@ class ProductType(DjangoObjectType):
return ProductAvailabilityType(**a._asdict())
-ProductType.Connection = connection_with_count(ProductType)
-
-
class CategoryType(DjangoObjectType):
products = DjangoConnectionField(
ProductType,
diff --git a/saleor/graphql/utils.py b/saleor/graphql/utils.py
index f8190695fc..e08e2bdf9f 100644
--- a/saleor/graphql/utils.py
+++ b/saleor/graphql/utils.py
@@ -29,20 +29,6 @@ class DjangoPkInterface(graphene.Interface):
return self.pk
-def connection_with_count(_type):
- class Connection(graphene.relay.Connection):
- total_count = graphene.Int()
-
- class Meta:
- name = _type._meta.name + 'Connection'
- node = _type
-
- def resolve_total_count(self, args, context, info):
- return len(self.edges)
-
- return Connection
-
-
def get_object_or_none(klass, *args, **kwargs):
queryset = _get_queryset(klass)
try: