Alembic v4.0.0 Alembic.RelationshipPath View Source

A relationship path is a dot-separated (U+002E FULL-STOP, “.”) list of relationship names.

JSON API > Fetching Data > Inclusion Of Related Resources

Link to this section Summary

Types

NOTE: Kept as a string until application can validate relationship name.

t()

A relationship path is a dot-separated (U+002E FULL-STOP, “.”) list of relationship names.

JSON API > Fetching Data > Inclusion Of Related Resources

Functions

Separator for relationship_names in a relationship_path

Breaks the relationship_path into relationship_names in a nested map to form Alembic.Fetch.Include.include

Link to this section Types

Link to this type relationship_name() View Source
relationship_name() :: String.t()

NOTE: Kept as a string until application can validate relationship name.

The name of a relationship.

A relationship path is a dot-separated (U+002E FULL-STOP, “.”) list of relationship names.

JSON API > Fetching Data > Inclusion Of Related Resources

Link to this section Functions

Link to this function relationship_name_separator() View Source

Separator for relationship_names in a relationship_path

Link to this function to_include(relationship_path) View Source
to_include(t()) :: Alembic.Fetch.Includes.include() | nil

Breaks the relationship_path into relationship_names in a nested map to form Alembic.Fetch.Include.include

A relationship name passes through unchanged

iex> Alembic.RelationshipPath.to_include("comments")
"comments"

A relationship path becomes a (nested) map

iex> Alembic.RelationshipPath.to_include("comments.author.posts")
%{
  "comments" => %{
    "author" => "posts"
  }
}