StoriesQuery

Builder for the query parameters of the retrieve multiple stories endpoint.

Every documented parameter has a dedicated, type-safe entry point. Fields of your own content types are addressed by a property reference of T, Story attributes are addressed by a property reference of Story:

client.stories<Article> {
sortBy(Article::headline) // sort_by=content.headline:asc
sortByDescending(Story<*>::publishedAt) // sort_by=published_at:desc
filter { Article::price greaterThan 100.0 } // filter_query[price][gt_float]=100.0
}

Type Parameters

T

The Component type the query is built for, whose properties the property-reference overloads accept.

Properties

Link copied to clipboard

Retrieve the stories matching these full slugs; supports * wildcards. Maps to by_slugs.

Link copied to clipboard

Retrieve the stories with these uuids, in the API's own order. Maps to by_uuids.

Link copied to clipboard

Retrieve the stories with these uuids, preserving the order given here. Maps to by_uuids_ordered.

Link copied to clipboard

Omit these content fields from the response to reduce its size. Maps to excluding_fields.

Link copied to clipboard

Exclude the stories with these ids. Maps to excluding_ids.

Link copied to clipboard

Exclude the stories matching these full slugs; supports * wildcards. Maps to excluding_slugs.

Link copied to clipboard

Retrieve stories first published after this instant. Maps to first_published_at_gt.

Link copied to clipboard

Retrieve stories first published before this instant. Maps to first_published_at_lt.

Link copied to clipboard

Retrieve the story as it appears in the release with this id. Maps to from_release.

Link copied to clipboard

Retrieve only start pages (true) or only non-start pages (false). Maps to is_startpage.

Link copied to clipboard

Retrieve stories published after this instant. Maps to published_at_gt.

Link copied to clipboard

Retrieve stories published at or after this instant. Maps to published_at_gte.

Link copied to clipboard

Retrieve stories published before this instant. Maps to published_at_lt.

Link copied to clipboard

Retrieve stories published at or before this instant. Maps to published_at_lte.

Link copied to clipboard

Search across all content fields, e.g. spaceship. Maps to search_term.

Link copied to clipboard

Filter by the full slug prefix, e.g. blog/posts, to retrieve the stories of a specific folder. Maps to the starts_with parameter.

Link copied to clipboard

Retrieve stories updated after this instant. Maps to updated_at_gt.

Link copied to clipboard

Retrieve stories updated before this instant. Maps to updated_at_lt.

Link copied to clipboard

Retrieve only stories carrying all of these tags. Maps to with_tag.

Functions

Link copied to clipboard
fun filter(block: FilterQueryBuilder<T>.() -> Unit)

Configure advanced filter queries targeting the fields of your content types, e.g.:

Link copied to clipboard
fun parameter(name: String, value: Any)

Set a query parameter directly, for forward compatibility with parameters this SDK version does not know about yet.

Link copied to clipboard
fun sortBy(field: KProperty1<in T, *>)

Sort the stories by the content field field ascending, e.g. Article::price. Call repeatedly, or alongside sortByDescending, to sort by several fields; they are applied in call order. Maps to sort_by, prefixed with content. as the API requires for content fields.

@JvmName(name = "sortByAttribute")
fun sortBy(field: KProperty1<Story<*>, *>)

Sort the stories ascending by the Story attribute field, e.g. Story<*>::publishedAt, rather than by a field of their content. Only some attributes are sortable; the API answers the rest with Not sortable by this column rather than the SDK second-guessing which those are.

fun sortBy(field: KProperty1<in T, *>, sortAs: SortAs)

Sort the stories by the content field field ascending, ordering it as sortAs states rather than as the property's type implies — for a number Storyblok holds in a text field, which is otherwise sorted as text.

Link copied to clipboard
fun sortByDescending(field: KProperty1<in T, *>)

Sort the stories by the content field field descending, see sortBy.

@JvmName(name = "sortByAttributeDescending")
fun sortByDescending(field: KProperty1<Story<*>, *>)

Sort the stories descending by the Story attribute field, see sortBy.

fun sortByDescending(field: KProperty1<in T, *>, sortAs: SortAs)

Sort the stories by the content field field descending, ordering it as sortAs states, see sortBy.