From 572c30570410adb9e0cc2e08ff97eb2fe94a48b3 Mon Sep 17 00:00:00 2001 From: Thiyagu2009 <85286091+Thiyagu2009@users.noreply.github.com> Date: Thu, 3 Jun 2021 17:44:53 +0530 Subject: [PATCH] Issue #1207 : Backward Pagination not working correctly when using with last and before arguments --- graphene_django/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphene_django/fields.py b/graphene_django/fields.py index e1972c7..64ea273 100644 --- a/graphene_django/fields.py +++ b/graphene_django/fields.py @@ -158,7 +158,8 @@ class DjangoConnectionField(ConnectionField): if max_limit is not None and args.get("first", None) is None: if args.get("last", None) is not None: - after = list_length - args["last"] + if args.get("before", None) is None: + after = list_length - args["last"] else: args["first"] = max_limit