---
id: w6/m5/t004
title: Regenerate codegen against live schema, diff hand-authored types
worker: worker6
status: done
estimate: 30m
depends_on: [w6/m5/t003]
---

## Objective

Re-run `yarn codegen` against the live bex-api GraphQL schema (the same bex-api t003 used) and diff it against the hand-authored `Workspace`/`createWorkspace`/`renameWorkspace`/`deleteWorkspace` additions in `dashboard/src/graphql/definitions.ts`, fixing any drift.

## Context

- `w6/done/m3/README.md`'s Follow-ups: *"Re-run `yarn codegen` against a live bex-api once one is reachable, and diff against the hand-authored ... additions in `src/graphql/definitions.ts` (no live schema/session token was available this session to run codegen for real)."*
- _2026-07-11: no cluster is required at all — `dashboard/codegen.ts` reaches any bex-api via `VITE_API_URL` + `CODEGEN_SESSION_TOKEN` (an Ory session token). Point it at whichever bex-api t003 used (e.g. `https://api.bex.co/graphql`) with a token from a real Kratos login; this replaces the earlier "reuse the t003 mock cluster session" framing._

## Steps

1. Export `VITE_API_URL` (the t003 bex-api GraphQL endpoint, e.g. `https://api.bex.co/graphql`) and `CODEGEN_SESSION_TOKEN` (from a real Kratos login), then run `yarn codegen`.
2. Diff the regenerated types against the hand-authored `Workspace`/`createWorkspace`/`renameWorkspace`/`deleteWorkspace` entries in `dashboard/src/graphql/definitions.ts`.
3. Fix any field/type mismatch found; if none, note that the hand-authored definitions were confirmed accurate.

## Files

- `dashboard/src/graphql/definitions.ts`
- Codegen output (wherever the dashboard's generated GraphQL types normally land)

## Acceptance criteria

- [ ] `yarn codegen` run successfully against a live bex-api schema
- [ ] Hand-authored workspace GraphQL definitions confirmed accurate or corrected to match
- [ ] Dashboard build/typecheck stays green after any fix

## Out of scope

- Codegen for non-workspace GraphQL surfaces (out of this milestone's scope).
