diff --git a/packages/gatsby-plugin-mdx/gatsby/on-create-node.js b/packages/gatsby-plugin-mdx/gatsby/on-create-node.js index 0c3c99c2a10e8..beaf50f2496bc 100644 --- a/packages/gatsby-plugin-mdx/gatsby/on-create-node.js +++ b/packages/gatsby-plugin-mdx/gatsby/on-create-node.js @@ -21,6 +21,7 @@ module.exports = async ( reporter, cache, pathPrefix, + ...helpers }, pluginOptions ) => { @@ -64,6 +65,10 @@ module.exports = async ( cache, pathPrefix, options, + loadNodeContent, + actions, + createNodeId, + ...helpers, }, { forceDisableCache: true } ) diff --git a/packages/gatsby-plugin-mdx/gatsby/source-nodes.js b/packages/gatsby-plugin-mdx/gatsby/source-nodes.js index d0db6111a204b..d01caa1f8ed50 100644 --- a/packages/gatsby-plugin-mdx/gatsby/source-nodes.js +++ b/packages/gatsby-plugin-mdx/gatsby/source-nodes.js @@ -52,7 +52,17 @@ async function getCounts({ mdast }) { } module.exports = ( - { store, pathPrefix, getNode, getNodes, cache, reporter, actions, schema }, + { + store, + pathPrefix, + getNode, + getNodes, + cache, + reporter, + actions, + schema, + ...helpers + }, pluginOptions ) => { let mdxHTMLLoader @@ -105,7 +115,19 @@ module.exports = ( } const processMDX = ({ node }) => - genMDX({ node, getNode, getNodes, reporter, cache, pathPrefix, options }) + genMDX({ + node, + options, + store, + pathPrefix, + getNode, + getNodes, + cache, + reporter, + actions, + schema, + ...helpers, + }) // New Code // Schema const MdxType = schema.buildObjectType({ diff --git a/packages/gatsby-plugin-mdx/utils/gen-mdx.js b/packages/gatsby-plugin-mdx/utils/gen-mdx.js index 77f030fcb28c3..add73b8f8e685 100644 --- a/packages/gatsby-plugin-mdx/utils/gen-mdx.js +++ b/packages/gatsby-plugin-mdx/utils/gen-mdx.js @@ -40,7 +40,17 @@ const BabelPluginPluckImports = require(`./babel-plugin-pluck-imports`) * */ module.exports = async function genMDX( - { isLoader, node, options, getNode, getNodes, reporter, cache, pathPrefix }, + { + isLoader, + node, + options, + getNode, + getNodes, + reporter, + cache, + pathPrefix, + ...helpers + }, { forceDisableCache = false } = {} ) { const pathPrefixCacheStr = pathPrefix || `` @@ -106,6 +116,7 @@ export const _frontmatter = ${JSON.stringify(data)}` reporter, cache, pathPrefix, + ...helpers, } ) diff --git a/packages/gatsby-plugin-mdx/utils/get-source-plugins-as-remark-plugins.js b/packages/gatsby-plugin-mdx/utils/get-source-plugins-as-remark-plugins.js index c4e36c764a133..05195131c118e 100644 --- a/packages/gatsby-plugin-mdx/utils/get-source-plugins-as-remark-plugins.js +++ b/packages/gatsby-plugin-mdx/utils/get-source-plugins-as-remark-plugins.js @@ -16,6 +16,7 @@ module.exports = async function getSourcePluginsAsRemarkPlugins({ reporter, cache, pathPrefix, + ...helpers }) { debug(`getSourcePluginsAsRemarkPlugins`) let pathPlugin = undefined @@ -63,6 +64,7 @@ module.exports = async function getSourcePluginsAsRemarkPlugins({ pathPrefix, reporter, cache, + ...helpers, }, plugin.options || {} )