story

inline fun <T : Component> StoryblokClient.story(slug: String, resolveLevel: Int = 1): Flow<Story<T>>(source)

Retrieves a Story by its slug using reified type information for the Component type.

Return

A Flow emitting the story, with potential cached and fresh values.

Parameters

slug

The URL path segment identifying the story.

resolveLevel

How deeply nested Story relations are resolved. 1 (the default) resolves direct relations; higher values resolve relations of relations; 0 disables relation resolution entirely — model relation fields as String to receive the raw uuids. Relations that cannot be resolved within the level (including circular relations) resolve to null for nullable story fields, and fail with a StoryblokClientException naming the uuid for non-nullable ones.

Type Parameters

T

The Component type of the story content.


inline fun <T : Component> StoryblokClient.story(uuid: Uuid, resolveLevel: Int = 1): Flow<Story<T>>(source)

Retrieves a Story by its UUID using reified type information for the Component type.

Return

A Flow emitting the story, with potential cached and fresh values.

Parameters

uuid

The unique identifier of the story.

resolveLevel

How deeply nested Story relations are resolved. 1 (the default) resolves direct relations; higher values resolve relations of relations; 0 disables relation resolution entirely — model relation fields as String to receive the raw uuids. Relations that cannot be resolved within the level (including circular relations) resolve to null for nullable story fields, and fail with a StoryblokClientException naming the uuid for non-nullable ones.

Type Parameters

T

The Component type of the story content.