Skip to content

Commit

Permalink
fix(gatsby-source-wordpress): WPGraphQL pageInfo is nullable, make su…
Browse files Browse the repository at this point in the history
…re we're not accessing hasNextPage on null (#32369)
  • Loading branch information
TylerBarnes authored Jul 14, 2021
1 parent 2d454e4 commit 53ae249
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ const paginatedWpNodeFetch = async ({
}

let {
[contentTypePlural]: { nodes, pageInfo: { hasNextPage, endCursor } = {} },
[contentTypePlural]: { nodes, pageInfo },
} = data

const { hasNextPage, endCursor } = pageInfo || {}

// Sometimes private posts return as null.
// That causes problems for us so let's strip them out
nodes = nodes.filter(Boolean)
Expand Down

0 comments on commit 53ae249

Please sign in to comment.