mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-12 09:12:18 +03:00
Fix backward Relay pagination
This commit is contained in:
parent
b552dcac24
commit
ca80585636
|
@ -150,7 +150,11 @@ class DjangoConnectionField(ConnectionField):
|
||||||
after = min(get_offset_with_default(args.get("after"), -1) + 1, list_length)
|
after = min(get_offset_with_default(args.get("after"), -1) + 1, list_length)
|
||||||
|
|
||||||
if max_limit is not None and "first" not in args:
|
if max_limit is not None and "first" not in args:
|
||||||
args["first"] = max_limit
|
if "last" in args:
|
||||||
|
args["first"] = list_length
|
||||||
|
list_slice_length = list_length
|
||||||
|
else:
|
||||||
|
args["first"] = max_limit
|
||||||
|
|
||||||
connection = connection_from_list_slice(
|
connection = connection_from_list_slice(
|
||||||
iterable[after:],
|
iterable[after:],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user