Skip to content

Commit 373c43b

Browse files
author
Carlos Carrascal Sanchez
committed
fix: avoid errors when excluding content types with multiple sources using the same schema
1 parent 8e90682 commit 373c43b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/source-node.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ exports.sourceNodes = async ({ cache, actions, getNode, getNodes, createNodeId,
9292
syncData.entry_published && syncData.entry_published.forEach(item => {
9393
item.content_type_uid = item.content_type_uid.replace(/-/g, '_');
9494
const contentType = contentTypesMap[item.content_type_uid];
95-
const normalizedEntry = normalizeEntry(contentType, item.data, entriesNodeIds, assetsNodeIds, createNodeId, typePrefix, configOptions);
96-
const entryNode = processEntry(contentType, normalizedEntry, createNodeId, createContentDigest, typePrefix);
97-
createNode(entryNode);
95+
if (contentType && !configOptions.excludeContentTypes?.includes(item?.content_type_uid)) {
96+
const normalizedEntry = normalizeEntry(contentType, item.data, entriesNodeIds, assetsNodeIds, createNodeId, typePrefix, configOptions);
97+
const entryNode = processEntry(contentType, normalizedEntry, createNodeId, createContentDigest, typePrefix);
98+
createNode(entryNode);
99+
}
98100
});
99101

100102
syncData.asset_published && syncData.asset_published.forEach(item => {

0 commit comments

Comments
 (0)