Skip to content

Commit

Permalink
fix(gatsby-source-contentful): fix missing linked assets when editing…
Browse files Browse the repository at this point in the history
… unrelated fields (#9303)
  • Loading branch information
pieh committed Oct 23, 2018
1 parent 63952c5 commit 3969a94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/gatsby-source-contentful/src/normalize.js
Expand Up @@ -89,7 +89,16 @@ exports.buildResolvableSet = ({
defaultLocale,
}) => {
const resolvable = new Set()
existingNodes.forEach(n => resolvable.add(n.id))
existingNodes.forEach(n => {
if (n.contentful_id) {
// We need to add only root level resolvable (assets and entries)
// derived nodes (markdown or JSON) will be recreated if needed.
// We also need to apply `fixId` as some objects will have ids
// prefixed with `c` and fixIds will recursively apply that
// and resolvable ids need to match that.
resolvable.add(fixId(n.contentful_id))
}
})

entryList.forEach(entries => {
entries.forEach(entry => {
Expand Down

0 comments on commit 3969a94

Please sign in to comment.