Skip to content

Commit 52a1dd4

Browse files
authored
Fixed Backward Pagination (PalisadoesFoundation#3239)
* fixed backward pagination * added tests for defaultGraphQLConnection.ts * coderabbitai suggested changes
1 parent 00a2e83 commit 52a1dd4

File tree

2 files changed

+553
-1
lines changed

2 files changed

+553
-1
lines changed

src/utilities/defaultGraphQLConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export const transformToDefaultGraphQLConnection = <
210210
if (rawNodes.length === limit) {
211211
connection.pageInfo.hasPreviousPage = true;
212212
// Remove the extra fetched node.
213-
rawNodes.shift();
213+
rawNodes.pop();
214214
} else {
215215
connection.pageInfo.hasPreviousPage = false;
216216
}

0 commit comments

Comments
 (0)