Alembic v2.1.0 Alembic.RelationshipPath

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

JSON API > Fetching Data > Inclusion Of Related Resources

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

Types

relationship_name :: String.t

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

The name of a relationship.

t :: String.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

relationship_name_separator()

Separator for relationship_names in a relationship_path

to_include(relationship_path)

Specs

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"
  }
}