json_api_query_builder v1.0.2 JsonApiQueryBuilder.Include View Source

Related resource include operations for JsonApiQueryBuilder

Link to this section Summary

Functions

Groups the include string by leading path segment

Applies related resource inclusion from a parsed JSON-API request to an Ecto.Queryable.t as preloads

Link to this section Functions

Link to this function group_includes(includes) View Source
group_includes(String.t()) :: [{String.t(), String.t()}]

Groups the include string by leading path segment.

Example

iex> JsonApiQueryBuilder.Include.group_includes("a,a.b,a.b.c,a.d,e")
[{"a", "b,b.c,d"}, {"e", ""}]
Link to this function include(query, params, callback) View Source
include(Ecto.Queryable.t(), map(), function()) :: Ecto.Queryable.t()

Applies related resource inclusion from a parsed JSON-API request to an Ecto.Queryable.t as preloads.

The given callback will be invoked for each included relationship with a new JSON-API style request.