Skip to content

Commit b81b8f3

Browse files
gatsbybotpieh
andauthored
fix(gatsby): don't remove onPluginInit in graphql-engine (#34558) (#34573)
Co-authored-by: Michal Piechowiak <[email protected]>
1 parent fe61ad8 commit b81b8f3

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)