contentful-labs / starter-gatsby-blog

Gatsby starter for a Contentful project from the community.
https://contentful.github.io/starter-gatsby-blog/
MIT License
195 stars 199 forks source link

Pass ownerNodeId to Gatsby plugin for content sync. #177

Open pvorozhe opened 2 years ago

pvorozhe commented 2 years ago

Content sync support requires ownerNodeId is passed into the create node method on the gatsby plugin side. This PR ensures that a node unique id is passed into the page create call.

What is Content sync?

Content Sync brings new super-powers to CMS Preview. When content editors click Open Preview, Content Sync jumps into action and routes content editors to the correct URL. It also helps them understand the status of preview, so they know when it's ready and if anything went wrong.

what is OwnerNodeId?

OwnerNodeId is used by gatsby to figure out which nodes need to be previewed after the Open Preview button is clicked. It uses a hierarchy of varying accuracy to determine which page the user intends to preview. Although other methods can be used to figure out the node Id, providing it directly from the queried post is the most accurate.

More detail?

See https://github.com/contentful/apps/pull/543