Contentful logo

Contentful Community

Best way to compare all draft vs published version of content in deeply nested component

I’m trying to create a tool to view a diff of the draft/changed vs published version of a component. This component can have many child components though. When I call getEntry() for the component, I would ideally get the content of all the children like in the delivery API, instead of just the ID of the children. How can I do this? Otherwise I need to recursively call getEntry() and getEntrySnapshot() on the children which is quite a lot of calls. Is there a better way? Ideally there would be a includes param like in the delivery API but I don’t think that exists for management api.

The Preview API behaves exactly like the Content Delivery API. Is there a specific reason you’re trying to use the Management API for draft/published comparison? It’s definitely a lot more work :slight_smile:

Oh that’s right! I could use the preview API. Great point.

Thanks so much.