Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contentful <3 gatsby v3 #29675

Merged
merged 4 commits into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/gatsby-source-contentful/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ exports.sourceNodes = async (
if (node.internal.owner !== `gatsby-source-contentful`) {
return
}
touchNode({ nodeId: node.id })
touchNode(node)
if (node.localFile___NODE) {
// Prevent GraphQL type inference from crashing on this property
touchNode({ nodeId: node.localFile___NODE })
touchNode(getNode(node.localFile___NODE))
}
})

Expand Down Expand Up @@ -329,7 +329,7 @@ exports.sourceNodes = async (
}

createTypes(`
interface ContentfulEntry @nodeInterface {
interface ContentfulEntry implements Node {
contentful_id: String!
id: ID!
node_locale: String!
Expand Down Expand Up @@ -488,7 +488,7 @@ exports.sourceNodes = async (

localizedNodes.forEach(node => {
// touchNode first, to populate typeOwners & avoid erroring
touchNode({ nodeId: node.id })
touchNode(node)
deleteNode(node)
})
}
Expand All @@ -499,7 +499,7 @@ exports.sourceNodes = async (
const existingNodes = getNodes().filter(
n => n.internal.owner === `gatsby-source-contentful`
)
existingNodes.forEach(n => touchNode({ nodeId: n.id }))
existingNodes.forEach(n => touchNode(n))

const assets = mergedSyncData.assets

Expand Down