Resolve relations with Storyblok Bridge

Changes in: app Permalink

It’s now possible to resolve relations with the live updates from the input event of the Storyblok Javascript bridge.

If you call the function resolveRelations the relations provided as second argument will be solved.

How to use?

You can use the storyblok bridge function .resolveRelations.

window.storyblok.resolveRelations(storyObject, relationsToResolve, callbackWhenResolved) 

in callback of the input event after the addComments function.

Example

window.storyblok.on('input', (data) => {
  window.storyblok.addComments(data.story.content, data.story.id)
  window.storyblok.resolveRelations(data.story, ['blog.author', 'blog.categories'], () => {
    // data.story.content has now the resolved relations
    // this.content = data.story.content
  })
})