Skip to content

Commit 9d33b10

Browse files
authoredJul 27, 2022
fix(gatsby): refactor sourceNodes api and add I&C/CFLOW as a codeowner (#36244)
refactor sourceNodes api and add I&C/CFLOW as a codeowner

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed
 

‎CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages/gatsby/src/utils/source-nodes-api-runner.ts @gatsbyjs/integrations-collaboration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Span } from "opentracing"
2+
import apiRunner from "./api-runner-node"
3+
4+
export function sourceNodesApiRunner({
5+
traceId,
6+
deferNodeMutation,
7+
parentSpan,
8+
webhookBody,
9+
pluginName,
10+
}: {
11+
traceId: string
12+
webhookBody: unknown
13+
pluginName?: string
14+
parentSpan?: Span
15+
deferNodeMutation?: boolean
16+
}): Promise<void> {
17+
return apiRunner(`sourceNodes`, {
18+
traceId,
19+
waitForCascadingActions: true,
20+
deferNodeMutation,
21+
parentSpan,
22+
webhookBody: webhookBody || {},
23+
pluginName,
24+
})
25+
}

‎packages/gatsby/src/utils/source-nodes.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import report from "gatsby-cli/lib/reporter"
22
import { Span } from "opentracing"
3-
import apiRunner from "./api-runner-node"
3+
import { sourceNodesApiRunner } from "./source-nodes-api-runner"
44
import { store } from "../redux"
55
import { getDataStore, getNode } from "../datastore"
66
import { actions } from "../redux/actions"
@@ -106,12 +106,11 @@ export default async ({
106106
const traceId = isInitialSourcing
107107
? `initial-sourceNodes`
108108
: `sourceNodes #${sourcingCount}`
109-
await apiRunner(`sourceNodes`, {
109+
await sourceNodesApiRunner({
110110
traceId,
111-
waitForCascadingActions: true,
112111
deferNodeMutation,
113112
parentSpan,
114-
webhookBody: webhookBody || {},
113+
webhookBody,
115114
pluginName,
116115
})
117116

0 commit comments

Comments
 (0)
Please sign in to comment.