-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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 hasNextPage pagination info when resultOffset is provided #32319
Merged
gatsbybot
merged 1 commit into
gatsbyjs:master
from
angeloashmore:fix-pagination-hasNextPage
Jul 15, 2021
Merged
fix(gatsby): correct hasNextPage pagination info when resultOffset is provided #32319
gatsbybot
merged 1 commit into
gatsbyjs:master
from
angeloashmore:fix-pagination-hasNextPage
Jul 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gatsbot
bot
added
the
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
label
Jul 9, 2021
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 15, 2021
vladar
approved these changes
Jul 15, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thank you 👍
vladar
changed the title
fix: correct hasNextPage pagination info when resultOffset is provided
fix(gatsby): correct hasNextPage pagination info when resultOffset is provided
Jul 15, 2021
vladar
added
the
bot: merge on green
Gatsbot will merge these PRs automatically when all tests passes
label
Jul 15, 2021
Thanks @vladar! |
gatsbybot
pushed a commit
that referenced
this pull request
Jul 16, 2021
… provided (#32319) (#32386) (cherry picked from commit 9f8a580) Co-authored-by: Angelo Ashmore <[email protected]>
gatsbybot
pushed a commit
that referenced
this pull request
Jul 23, 2021
LekoArts
pushed a commit
that referenced
this pull request
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 <[email protected]>
This was referenced Oct 1, 2023
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the
hasNextPage
field in thepageInfo
data for paginated queries. When querying for paginated content usingskip
andlimit
, thehasNextPage
field was returningfalse
for anything other than the first page, even if it a next page of nodes exists.Example query:
If there were a total of 6 nodes,
hasNextPage
was returningfalse
. It now returnstrue
.The logic for determining the value of
hasNextPage
is edited in this PR and includes comments describing the logic.Documentation
Existing documentation: https://www.gatsbyjs.com/docs/schema-root-fields/#pagination-types
There is no need to update the documentation as this is a bug fix.
Related Issues
None