# `ExUtcp.Transports.Graphql.Connection`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/transports/graphql/connection.ex#L1)

Manages GraphQL connections with pooling and lifecycle management.

# `t`

```elixir
@type t() :: %ExUtcp.Transports.Graphql.Connection{
  client: Req.Request.t(),
  connection_state: :connecting | :connected | :disconnected | :error,
  last_used: DateTime.t(),
  max_retries: non_neg_integer(),
  provider: map(),
  retry_count: non_neg_integer(),
  subscription_handles: %{required(String.t()) =&gt; pid()}
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `close`

```elixir
@spec close(pid()) :: :ok
```

Closes the GraphQL connection.

# `get_last_used`

```elixir
@spec get_last_used(pid()) :: integer()
```

Gets the last used timestamp.

# `healthy?`

```elixir
@spec healthy?(pid()) :: boolean()
```

Checks if the connection is healthy.

# `introspect_schema`

```elixir
@spec introspect_schema(
  pid(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

Introspects the GraphQL schema.

# `mutation`

```elixir
@spec mutation(pid(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
```

Executes a GraphQL mutation.

# `query`

```elixir
@spec query(pid(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, term()}
```

Executes a GraphQL query.

# `start_link`

```elixir
@spec start_link(
  map(),
  keyword()
) :: {:ok, pid()} | {:error, term()}
```

Starts a new GraphQL connection process.

# `subscription`

```elixir
@spec subscription(pid(), String.t(), map(), keyword()) ::
  {:ok, [map()]} | {:error, term()}
```

Executes a GraphQL subscription.

# `update_last_used`

```elixir
@spec update_last_used(pid()) :: :ok
```

Updates the last used timestamp.

---

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