# `Ecto.ERD.Field`
[🔗](https://github.com/fuelen/ecto_erd/blob/v0.7.0/lib/ecto/erd/field.ex#L1)

Field struct.

Represents the data for an individual field in `Ecto.ERD.Node`.

You can update fields on this struct in `.ecto_erd.exs` if needed.

# `comment`

```elixir
@type comment() :: String.t()
```

A field comment.

Rendering comments is currently supported only by the Mermaid format.

## Example

    # File: .ecto_erd.exs
    [
      map_node: fn
        %Ecto.ERD.Node{schema_module: schema_module} = node ->
          update_in(node, [Access.key(:fields), Access.all()], fn field ->
            # `DocumentationLib` is a fictional module that returns documentation about a field
            case DocumentationLib.doc({schema_module, field}) do
              nil ->
                field

              doc ->
                %{field | comment: doc}
            end
          end)
        end
    ]

# `t`

```elixir
@type t() :: %Ecto.ERD.Field{
  comment: comment() | nil,
  name: atom(),
  primary?: boolean(),
  type: atom() | tuple()
}
```

# `new`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
