---
id: w3/m1/t005
title: GraphQL logs resolver + unit tests
worker: worker3
status: done
estimate: 30m
depends_on: [w3/m1/t001, w3/m1/t002]
---

## Objective

Expose logs to the dashboard-compatible GraphQL adapter and add unit coverage for the logs path.

## Context

- GraphQL adapter is `operator/internal/api/graphql.go`; every resolver delegates to `Core` (`docs/ADR006-bex-api.md`).
- Existing tests live in `operator/internal/api/api_test.go`.
- Mirror Render dashboard operation naming where captured; otherwise a `logs(resource, type, ...)` query returning the same normalized lines.

## Steps

1. Add a `logs(...)` query + `LogLine` type to `graphql.go`, delegating to `Core.Logs`.
2. Add unit tests in `api_test.go` covering the REST endpoint (t002) and the resolver (filters, envelope shape).

## Files

- `operator/internal/api/graphql.go`, `operator/internal/api/api_test.go`

## Acceptance criteria

- [ ] `query { logs(resource: "<app>", type: application) { timestamp instance message } }` returns lines via `Core`.
- [ ] `make test` green with new coverage for REST + GraphQL logs paths.

## Out of scope

- Metrics (w3/m2).
