Skip to content

Commit

Permalink
fix(gatsby): refactor sourceNodes api and add I&C/CFLOW as a codeowner (
Browse files Browse the repository at this point in the history
#36244)

refactor sourceNodes api and add I&C/CFLOW as a codeowner
  • Loading branch information
TylerBarnes committed Jul 27, 2022
1 parent abc65a6 commit 9d33b10
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1 @@
packages/gatsby/src/utils/source-nodes-api-runner.ts @gatsbyjs/integrations-collaboration
25 changes: 25 additions & 0 deletions packages/gatsby/src/utils/source-nodes-api-runner.ts
@@ -0,0 +1,25 @@
import { Span } from "opentracing"
import apiRunner from "./api-runner-node"

export function sourceNodesApiRunner({
traceId,
deferNodeMutation,
parentSpan,
webhookBody,
pluginName,
}: {
traceId: string
webhookBody: unknown
pluginName?: string
parentSpan?: Span
deferNodeMutation?: boolean
}): Promise<void> {
return apiRunner(`sourceNodes`, {
traceId,
waitForCascadingActions: true,
deferNodeMutation,
parentSpan,
webhookBody: webhookBody || {},
pluginName,
})
}
7 changes: 3 additions & 4 deletions packages/gatsby/src/utils/source-nodes.ts
@@ -1,6 +1,6 @@
import report from "gatsby-cli/lib/reporter"
import { Span } from "opentracing"
import apiRunner from "./api-runner-node"
import { sourceNodesApiRunner } from "./source-nodes-api-runner"
import { store } from "../redux"
import { getDataStore, getNode } from "../datastore"
import { actions } from "../redux/actions"
Expand Down Expand Up @@ -106,12 +106,11 @@ export default async ({
const traceId = isInitialSourcing
? `initial-sourceNodes`
: `sourceNodes #${sourcingCount}`
await apiRunner(`sourceNodes`, {
await sourceNodesApiRunner({
traceId,
waitForCascadingActions: true,
deferNodeMutation,
parentSpan,
webhookBody: webhookBody || {},
webhookBody,
pluginName,
})

Expand Down

0 comments on commit 9d33b10

Please sign in to comment.