---
id: w5/m5/t002
title: server(id) query + codegen; /services/$serviceId overview route
worker: worker5
status: done
estimate: 50m
depends_on: [w5/m5/t001]
---

## Objective

Add the `server(id)` GraphQL query, generate typed operations, and build the `/services/$serviceId` overview route rendering the service's live overview fields per the t001 Render reference.

## Context

- Codegen: `codegen.ts` → `src/graphql/definitions.ts` (needs `CODEGEN_SESSION_TOKEN`).
- Render `server(id)` shape (`docs/ADR006-bex-api.md`): `phase`, `serviceDetails.url`, `revision`, `replicas`, `createdAt`, string `suspended`.
- Strings via `useTranslations()`, `services.*` namespace.

## Steps

1. Add `src/features/services/api/server.graphql` with the `server(id)` query; regenerate codegen.
2. Create `src/routes/services.$serviceId.index.tsx` (or the equivalent overview route) rendering the overview panel — phase, url, revision, replicas, createdAt, suspended — laid out per t001.
3. Handle loading/error/not-found states; localize new strings.

## Files

- `src/features/services/api/server.graphql` (new)
- `src/graphql/definitions.ts` (regenerated)
- `src/routes/services.$serviceId.index.tsx` (new)
- `src/features/services/locales/{en,zh}.ts`

## Acceptance criteria

- [x] `/services/$serviceId` renders live `server(id)` overview data.
- [x] Loading / error / not-found states handled.
- [x] `yarn typecheck` passes.

## Out of scope

- Service-nav chrome (t003), header actions (t004).
