diff --git a/packages/gatsby-plugin-mdx/loaders/mdx-loader.test.js b/packages/gatsby-plugin-mdx/loaders/mdx-loader.test.js index d646833475e3c..397e8c28ba308 100644 --- a/packages/gatsby-plugin-mdx/loaders/mdx-loader.test.js +++ b/packages/gatsby-plugin-mdx/loaders/mdx-loader.test.js @@ -74,7 +74,10 @@ describe(`mdx-loader`, () => { } }, query: { - getNodes() { + getNodes(_type) { + return fixtures.map(([, node]) => node) + }, + getNodesByType(_type) { return fixtures.map(([, node]) => node) }, pluginOptions: {}, 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 b361135c21c67..5a8a61039ad88 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 @@ -13,7 +13,7 @@ module.exports = async function getSourcePluginsAsRemarkPlugins({ gatsbyRemarkPlugins, mdxNode, getNode, - getNodes, + getNodesByType, reporter, cache, pathPrefix, @@ -39,7 +39,7 @@ module.exports = async function getSourcePluginsAsRemarkPlugins({ } } - fileNodes = getNodes().filter(n => n.internal.type === `File`) + fileNodes = getNodesByType(`File`) // return list of remarkPlugins const userPlugins = gatsbyRemarkPlugins