diff --git a/docs/docs/how-to/routing/migrate-remark-to-mdx.md b/docs/docs/how-to/routing/migrate-remark-to-mdx.md index 91a3bf478d7ae..684adb9f9750a 100644 --- a/docs/docs/how-to/routing/migrate-remark-to-mdx.md +++ b/docs/docs/how-to/routing/migrate-remark-to-mdx.md @@ -62,6 +62,13 @@ const result = await graphql( ) { ``` +Don't forget to update the `posts` constant by replacing `allMarkdownRemark` with `allMdx`. + +```diff:title=gatsby-node.js +-const posts = result.data.allMarkdownRemark.nodes ++const posts = result.data.allMdx.nodes +``` + Also, update `onCreateNode` which creates the blog post slugs to watch for the node type of `Mdx` instead of `MarkdownRemark`. ```diff:title=gatsby-node.js