File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
packages/gatsby-source-wordpress/src/steps/source-nodes Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -12,24 +12,19 @@ import { sourcePreviews } from "~/steps/preview"
12
12
const sourceNodes : Step = async helpers => {
13
13
const { cache, webhookBody, refetchAll } = helpers
14
14
15
+ // fetch non-node root fields such as settings.
16
+ // For now, we're refetching them on every build
17
+ const nonNodeRootFieldsPromise = fetchAndCreateNonNodeRootFields ( )
18
+
15
19
// if this is a preview we want to process it and return early
16
- if ( webhookBody . preview ) {
20
+ if ( webhookBody . token && webhookBody . userDatabaseId ) {
17
21
await sourcePreviews ( helpers )
18
-
22
+ await nonNodeRootFieldsPromise
19
23
return
20
24
}
21
- // if it's not a preview but we have a token
22
- // we should source any pending previews then continue sourcing
23
- else if ( webhookBody . token && webhookBody . userDatabaseId ) {
24
- await sourcePreviews ( helpers )
25
- }
26
25
27
26
const now = Date . now ( )
28
27
29
- // fetch non-node root fields such as settings.
30
- // For now, we're refetching them on every build
31
- const nonNodeRootFieldsPromise = fetchAndCreateNonNodeRootFields ( )
32
-
33
28
const lastCompletedSourceTime =
34
29
webhookBody . refreshing && webhookBody . since
35
30
? webhookBody . since
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export const fetchAndCreateSingleNode = async ({
24
24
singleName,
25
25
id,
26
26
actionType,
27
- cachedNodeIds,
27
+ cachedNodeIds = [ ] ,
28
28
token = null ,
29
29
isPreview = false ,
30
30
isDraft = false ,
You can’t perform that action at this time.
0 commit comments