ArangoXEcto.Edge.edges_changeset

You're seeing just the function edges_changeset, go back to ArangoXEcto.Edge module for more information.
Link to this function

edges_changeset(edge, attrs)

View Source

Specs

edges_changeset(%ArangoXEcto.Edge{_from: term(), to: term()}, %{}) ::
  %ArangoXEcto.Edge{_from: term(), to: term()}

Default changeset for an edge.

Casts and requires the _from and _to fields. This will also verify the format of both fields to match that of an Arango id.

Any custom changeset should first use this changeset.

Direct use of the edges_changeset/2 function is discouraged unless per the use case mentioned above.

Example

To add a required type field, you could do the following:

def changeset(edge, attrs) do
  edges_changeset(edge, attrs)
  |> cast(attrs, [:type])
  |> validate_required([:type])
end