Skip to content

Commit

Permalink
fix(gatsby): don't remove onPluginInit in graphql-engine (#34558) (#3…
Browse files Browse the repository at this point in the history
…4586)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
  • Loading branch information
ViCo0TeCH and pieh committed Jan 25, 2022
1 parent 17e8698 commit e39f6cd
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 e39f6cd

Please sign in to comment.