Skip to content

Commit 8da83ff

Browse files
piehmarvinjude
authored andcommitted
fix(gatsby): don't remove onPluginInit in graphql-engine (#34558)
(cherry picked from commit 135e080)
1 parent 17e8698 commit 8da83ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gatsby/src/schema/graphql-engine/webpack-remove-apis-loader.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { GatsbyNodeAPI } from "../../redux/types"
33
import * as nodeApis from "../../utils/api-node-docs"
44
import { schemaCustomizationAPIs } from "./print-plugins"
55

6+
const apisToKeep = new Set(schemaCustomizationAPIs)
7+
apisToKeep.add(`onPluginInit`)
8+
69
module.exports = function loader(source: string): string | null | undefined {
710
const result = transformSync(source, {
811
babelrc: false,
@@ -12,7 +15,7 @@ module.exports = function loader(source: string): string | null | undefined {
1215
require.resolve(`../../utils/babel/babel-plugin-remove-api`),
1316
{
1417
apis: (Object.keys(nodeApis) as Array<GatsbyNodeAPI>).filter(
15-
api => !schemaCustomizationAPIs.has(api)
18+
api => !apisToKeep.has(api)
1619
),
1720
},
1821
],

0 commit comments

Comments
 (0)