graphql-python / graphql-python/graphene-django

Backward Pagination not working correctly when using with last and before arguments

Open
#1,207 2 comments 0 reactions 0 assignees View on GitHub
🐛bug
Dominant language
Python
Stars
4.4k
Forks
760
PR merge metrics
No merged PRs in 30d

Description

* **When we query the connection field with both last and before arguments it is not working as expected**

* **Steps to reproduce**

1. Querying all nodes
![image](https://user-images.githubusercontent.com/85286091/120629085-1363ce80-c483-11eb-821b-c7f32b320f26.png)

2. Copying the third node's edge's cursor and querying for before 2 nodes
![image](https://user-images.githubusercontent.com/85286091/120630051-0f847c00-c484-11eb-98e3-ddab3ff597a5.png)

* **It should return previous two nodes instead it is returning only one**

* **This issue occurs because the slicing of the edges occurs from last node(with cursor YXJyYXljb25uZWN0aW9uOjI=) instead of before node(with cursor YXJyYXljb25uZWN0aW9uOjE=)**

* **Environment:**

- Version: 3.0.0b7
- Platform: MacOs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.