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
…4573)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
  • Loading branch information
gatsbybot and pieh authored Jan 24, 2022
1 parent fe61ad8 commit b81b8f3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 b81b8f3

Please sign in to comment.