Ash.Info.Manifest.Relationship (ash v3.25.1)

Copy Markdown View Source

Represents a resource relationship in the API specification.

filterable? / sortable? say whether the relationship participates in filter/sort inputs. The shape of the operation (dot-traversal vs. existential quantifier, single-record sort vs. none) is derivable from cardinality: :one relationships can be dot-traversed and sorted by; :many relationships need an exists-style predicate for filters and have no well-defined whole-set ordering for sorts.

Summary

Types

relationship_type()

@type relationship_type() :: :has_many | :has_one | :belongs_to | :many_to_many

t()

@type t() :: %Ash.Info.Manifest.Relationship{
  allow_nil?: boolean(),
  cardinality: :one | :many,
  custom: map(),
  description: String.t() | nil,
  destination: atom(),
  filterable?: boolean(),
  name: atom(),
  sortable?: boolean(),
  type: relationship_type()
}