Skip to content

Commit

Permalink
fix(gatsby): don't remove onPluginInit in graphql-engine (#34558)
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Jan 21, 2022
1 parent 3659ec2 commit 135e080
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -3,6 +3,9 @@ import { GatsbyNodeAPI } from "../../redux/types"
import * as nodeApis from "../../utils/api-node-docs"
import { schemaCustomizationAPIs } from "./print-plugins"

const apisToKeep = new Set(schemaCustomizationAPIs)
apisToKeep.add(`onPluginInit`)

module.exports = function loader(source: string): string | null | undefined {
const result = transformSync(source, {
babelrc: false,
Expand All @@ -12,7 +15,7 @@ module.exports = function loader(source: string): string | null | undefined {
require.resolve(`../../utils/babel/babel-plugin-remove-api`),
{
apis: (Object.keys(nodeApis) as Array<GatsbyNodeAPI>).filter(
api => !schemaCustomizationAPIs.has(api)
api => !apisToKeep.has(api)
),
},
],
Expand Down

0 comments on commit 135e080

Please sign in to comment.