# `NebulaGraphEx.Query`
[🔗](https://github.com/VChain/nebula_graph_ex/blob/v0.1.10/lib/nebula_graph_ex/query.ex#L1)

Represents a nGQL query to be executed against NebulaGraph.

You typically do not build `%Query{}` structs directly — use
`NebulaGraphEx.Graph.query/4` instead. The struct is part of the public API
so that callers can introspect prepared queries or pass them to
`DBConnection.execute/4` directly when using the connection without the pool.

## Fields

* `:statement` — nGQL string to execute
* `:params` — map of binary keys to parameter values (for `executeWithParameter`)
* `:opts` — per-query option overrides (see `NebulaGraphEx.Options`)

# `t`

```elixir
@type t() :: %NebulaGraphEx.Query{
  opts: keyword(),
  params: map(),
  statement: String.t()
}
```

# `new`

```elixir
@spec new(String.t(), map(), keyword()) :: t()
```

Builds a `%Query{}` struct.

## Examples

    iex> NebulaGraphEx.Query.new("RETURN 1")
    %NebulaGraphEx.Query{statement: "RETURN 1", params: %{}, opts: []}

    iex> NebulaGraphEx.Query.new(
    ...>   "MATCH (v:Player{name: $name}) RETURN v",
    ...>   %{"name" => "Tim Duncan"}
    ...> )
    %NebulaGraphEx.Query{
      statement: "MATCH (v:Player{name: $name}) RETURN v",
      params: %{"name" => "Tim Duncan"},
      opts: []
    }

---

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