Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby): correct pagination logic #32496

Merged
merged 3 commits into from Jul 23, 2021
Merged

fix(gatsby): correct pagination logic #32496

merged 3 commits into from Jul 23, 2021

Conversation

vladar
Copy link
Contributor

@vladar vladar commented Jul 23, 2021

Description

This PR fixes an issue with incorrect pagination logic introduced in a recent refactor: #32135

The previous attempt in #32319 in fact contains incorrect assumptions about pagination logic. The actual issue was not in paginate function itself but one level higher in the method that accounts for item paddings.

This PR fixes the issue and adds tests at the correct level of abstraction. The first commit is just a revert of #32319 so the actual fix is in the second commit (for the review): 1d19c08

Fixes #32485

[ch35018]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 23, 2021
@vladar vladar added topic: GraphQL Related to Gatsby's GraphQL layer and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 23, 2021
@vladar vladar added this to To cherry-pick in V3 Release Hotfixes via automation Jul 23, 2021
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it

@vladar vladar added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jul 23, 2021
@gatsbybot gatsbybot merged commit 2dbe647 into master Jul 23, 2021
@gatsbybot gatsbybot deleted the vladar/fix-pagination branch July 23, 2021 18:51
LekoArts pushed a commit that referenced this pull request Jul 26, 2021
* Revert "fix(gatsby): correct hasNextPage pagination info when resultOffset is provided (#32319)"

This reverts commit 9f8a580

* fix(gatsby): fixed pagination logic

* try to make tests less confusing

(cherry picked from commit 2dbe647)
@LekoArts LekoArts moved this from To cherry-pick to Backport PR opened in V3 Release Hotfixes Jul 26, 2021
LekoArts pushed a commit that referenced this pull request Jul 26, 2021
* Revert "fix(gatsby): correct hasNextPage pagination info when resultOffset is provided (#32319)"

This reverts commit 9f8a580

* fix(gatsby): fixed pagination logic

* try to make tests less confusing

(cherry picked from commit 2dbe647)

Co-authored-by: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
@LekoArts LekoArts moved this from Backport PR opened to Backported in V3 Release Hotfixes Jul 26, 2021
@LekoArts LekoArts moved this from Backported to Published in V3 Release Hotfixes Jul 26, 2021
@LekoArts
Copy link
Contributor

Published in gatsby@3.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: GraphQL Related to Gatsby's GraphQL layer
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

graphql pageInfo.hasNextPage did not work properly after upgrade packages to latest version
4 participants