# `NebulaGraphEx.Types.Vertex`
[🔗](https://github.com/VChain/nebula_graph_ex/blob/v0.1.10/lib/nebula_graph_ex/types/vertex.ex#L1)

Represents a NebulaGraph vertex (node).

A vertex has a `vid` (vertex ID, either an integer or string depending on
the space's VID type) and a list of `%NebulaGraphEx.Types.Tag{}` structs,
each carrying a set of properties.

## Fields

* `:vid` — vertex ID; decoded to `integer()` or `binary()`.
* `:tags` — list of `%NebulaGraphEx.Types.Tag{}` structs.

## Example

    %NebulaGraphEx.Types.Vertex{
      vid: "player100",
      tags: [
        %NebulaGraphEx.Types.Tag{
          name: "Player",
          props: %{"name" => "Tim Duncan", "age" => 42}
        }
      ]
    }

# `t`

```elixir
@type t() :: %NebulaGraphEx.Types.Vertex{
  tags: [NebulaGraphEx.Types.Tag.t()],
  vid: integer() | String.t()
}
```

# `prop`

```elixir
@spec prop(t(), String.t(), String.t()) :: term()
```

Returns the property value for `prop_name` in the first tag named `tag_name`,
or `nil` if either the tag or the property is absent.

# `tag`

```elixir
@spec tag(t(), String.t()) :: NebulaGraphEx.Types.Tag.t() | nil
```

Returns the first tag matching `name`, or `nil` if not present.

## Example

    Vertex.tag(vertex, "Player")
    #=> %Tag{name: "Player", props: %{"name" => "Tim Duncan"}}

---

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