View Source Resourceful.Type.GraphedField (Resourceful v0.1.2)

A graphed field is a field (an attribute or a relationship) bundled with graph data dictating how it is to be mapped in a graph from the perspective of a type.

For example, while the attribute title on an album will always be the same value. However, when that attribute is viewed from the perspective of a song or an artist graph information needs to be included. On it's own the attribute might map to :title but from a song it would map to [:album, :title].

The query_alias is used for Ecto to idenify a join with the :as option used.

Link to this section Summary

Functions

Creates a new graphed field.

Link to this section Functions

Link to this function

new(field, name, map_to, parent \\ nil)

View Source
@spec new(
  Resourceful.Type.field(),
  String.t(),
  list(),
  %Resourceful.Type.GraphedField{
    field: term(),
    map_to: term(),
    name: term(),
    parent: term(),
    query_alias: term()
  }
  | nil
) :: %Resourceful.Type.GraphedField{
  field: term(),
  map_to: term(),
  name: term(),
  parent: term(),
  query_alias: term()
}

Creates a new graphed field.

This function will almost never be called directly but rather as part of Resourceful.Registry.build_field_graph/2.