GraphQL API

Embed
Preview of the card
<a href="https://forumulate.com/p/watchtower/docs/graphql"><img src="https://forumulate.com/api/public/orgs/watchtower/spaces/docs/pages/778149b3-eaaa-42a1-84e7-9b70c88932d6/social-card.svg?v=3e7ae33eec8b" alt="GraphQL API" width="600" height="315"></a>

A read-only GraphQL endpoint over the same data as the REST API. For changes (create, update, delete) use REST under /v1; the GraphQL schema has no mutations.

Endpoint

Purpose

POST /v1/graphql

Run a query: {"query", "operationName", "variables"}

GET /v1/graphql/schema.graphql

The schema as SDL (any authenticated caller)

POST /v1/graphql/persisted

{"query"} returns {"id": "<sha256>"}; run it later with the header X-Wt-Persisted-Query: <id>

Authentication and access

Same as REST: a session cookie or an API key, service-account key or personal token in Authorization: Bearer. Scoped keys need admin:read. Every field checks the same permissions as its REST twin and is limited to the project you pass. An object you cannot reach resolves to null with extensions.code = "not_found"; the API never answers forbidden, so a missing object and a hidden one look the same.

Queries

projects(org), project(id), services(project), service(project, name), issue, issues, alertRule, alertRules, alert, incident, incidents, monitor, dashboard, release(project, version), deployment, team(project, slug), entity.

Edges: service.issues, service.owner, service.dependencies and service.dependents (the last hour of the dependency map), issue.release, issue.assignee, alert.rule, alert.incident, incident.timeline, entity.links, entity.neighbors(depth: 1..3).

services lists services that have a catalog entry. service.issues returns issues recorded against that service name.

Pagination

Lists take first (1 to 200) and after, and return {nodes, pageInfo{hasNextPage, endCursor}}. endCursor is the REST next_cursor of the same page, so the two APIs are interchangeable mid-listing.

Limits

Depth 10, complexity 1,000 (a list field costs first), 10 s per request, 128 KiB body. Introspection is off unless WT_GRAPHQL_INTROSPECTION=1 (on in development builds); use the SDL endpoint instead. Edges load through per-request batching, so asking for the issues of many services costs one query.

Updated