Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use PrefetchingConnectionField as base class for FilterInputConnectionField
Krzysztof Świąteke7882ef1c63c
diff --git a/saleor/graphql/core/connection.py b/saleor/graphql/core/connection.pyindex 92375e0366..031432cfa1 100644--- a/saleor/graphql/core/connection.py+++ b/saleor/graphql/core/connection.py@@ -68,7 +68,7 @@ def connection_from_queryset_slice(has_previous_page = Falsehas_next_page = Falseif previous_page_margin:- has_previous_page = len(matching_records > 0)+ has_previous_page = len(matching_records) > 0matching_records = matching_records[previous_page_margin:]if requested_count is not None:has_next_page = len(matching_records) > requested_countdiff --git a/saleor/graphql/core/fields.py b/saleor/graphql/core/fields.pyindex 3c34e778f2..db1481138e 100644--- a/saleor/graphql/core/fields.py+++ b/saleor/graphql/core/fields.py@@ -107,7 +107,7 @@ class PrefetchingConnectionField(BaseDjangoConnectionField):return connection-class FilterInputConnectionField(BaseDjangoConnectionField):+class FilterInputConnectionField(PrefetchingConnectionField):def __init__(self, *args, **kwargs):self.filter_field_name = kwargs.pop("filter_field_name", "filter")self.filter_input = kwargs.get(self.filter_field_name)