From 7b4f88246058ff184d96b5c226d9f7eef7a93512 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sat, 28 Dec 2024 18:56:27 +0000 Subject: [PATCH] mutation issue Signed-off-by: Shivam Gupta --- gatsby-config.js | 2 +- gatsby-node.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index c6fab89b8e09..773e33bffba3 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -14,7 +14,7 @@ module.exports = { flags: { FAST_DEV: true, PARALLEL_SOURCING: true, - // PRESERVE_FILE_DOWNLOAD_CACHE: true, + PRESERVE_FILE_DOWNLOAD_CACHE: true, DETECT_NODE_MUTATIONS: true, PARTIAL_HYDRATION: true }, diff --git a/gatsby-node.js b/gatsby-node.js index c38e2531ceed..9f44ad37dbb9 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -905,6 +905,15 @@ exports.onCreateNode = ({ node, actions, getNode }) => { onCreateChapterNode({ actions, node, slug }); return; } + + if (node.internal.type === "Mdx") { + if (!node.frontmatter.thumbnail) { + node.frontmatter.thumbnail = null; + } + if (!node.frontmatter.darkthumbnail) { + node.frontmatter.darkthumbnail = null; + } + } } } };