Skip to content

Conversation

@TylerBarnes
Copy link
Contributor

This fixes an issue @graysonhicks was debugging.

WPGraphQL's pageInfo field is nullable, so we need to make sure we're not accessing hasNextPage on null.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 14, 2021
@TylerBarnes TylerBarnes requested a review from graysonhicks July 14, 2021 19:19
@TylerBarnes TylerBarnes added topic: source-wordpress Related to Gatsby's integration with WordPress and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 14, 2021
@TylerBarnes TylerBarnes requested a review from DanielSLew July 14, 2021 19:20

let {
[contentTypePlural]: { nodes, pageInfo: { hasNextPage, endCursor } = {} },
[contentTypePlural]: { nodes, pageInfo },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these look almost the same. Where this is different is we never get to the = {} value fallback since null is a value.

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: source-wordpress Related to Gatsby's integration with WordPress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants