Skip to content

Commit

Permalink
feat(gatsby-source-wordpress): always include draft slugs (#35573)
Browse files Browse the repository at this point in the history
* always set a slug for draft nodes

* Update update.js

* Update update.js
  • Loading branch information
TylerBarnes authored May 3, 2022
1 parent abc6dca commit 128c7bb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export const fetchAndCreateSingleNode = async ({
id,
})

if (isPreview && `slug` in remoteNode && !remoteNode.slug) {
// sometimes preview nodes do not have a slug - but some users will use slugs to build page urls. So we should make sure we have something for the slug.
remoteNode.slug = id
}

if (isPreview) {
const existingNode = getNode(id)

Expand Down

0 comments on commit 128c7bb

Please sign in to comment.