Skip to content

Commit

Permalink
fix(gatsby-source-wordpress): previewing drafts requires using the pr…
Browse files Browse the repository at this point in the history
…eview query (#31133) (#31243)

(cherry picked from commit 53f7d7d)

Co-authored-by: Tyler Barnes <tyler@gatsbyjs.com>
  • Loading branch information
GatsbyJS Bot and TylerBarnes committed May 4, 2021
1 parent 1861243 commit 22590b4
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -20,7 +20,6 @@ export const fetchAndCreateSingleNode = async ({
id,
actionType,
cachedNodeIds,
isDraft,
token = null,
isPreview = false,
userDatabaseId = null,
Expand All @@ -33,7 +32,7 @@ export const fetchAndCreateSingleNode = async ({
// if it's a preview but it's the initial blank node
// then use the regular node query as the preview query wont
// return anything
const query = isPreview && !isDraft ? previewQuery : nodeQuery
const query = isPreview ? previewQuery : nodeQuery

return query
}
Expand Down

0 comments on commit 22590b4

Please sign in to comment.