---
id: w6/m12/t003
title: "GraphQL changeWorkspacePlan mutation + definitions.ts sync"
worker: worker6
status: todo
estimate: 30m
depends_on: [w6/m12/t002]
---

## Objective

Expose `ChangePlan` as a GraphQL mutation `changeWorkspacePlan(id, plan)` alongside the existing lifecycle mutations, and sync the dashboard's hand-authored GraphQL definitions — REST and MCP deliberately gain nothing (absence is the parity-correct shape).

## Context

- Lifecycle mutations live in `lego/backend/internal/workspaces/graphql.go` (`GraphQLMutation`: `createWorkspace`/`renameWorkspace`/`deleteWorkspace`) — mirror their arg/result shape.
- Dashboard definitions: `dashboard/src/graphql/definitions.ts` must stay byte-consistent with `graphql.go` (the w6/m5 codegen-drift lesson — verify by source-diff).
- MCP (`internal/workspaces/mcp.go`) is read-only by design (Render's MCP has no workspace mutations); REST owners surface is read-only (research finding 9).

## Steps

1. Add the mutation field delegating to `Service.ChangePlan`, returning the updated workspace view.
2. Sync `definitions.ts` and any workspace feature `.graphql` documents.
3. Assert surface parity in the existing workspaces surface-parity test if one covers mutations.

## Files

- `lego/backend/internal/workspaces/graphql.go`
- `dashboard/src/graphql/definitions.ts`

## Acceptance criteria

- [ ] `changeWorkspacePlan` returns the updated plan; guard errors surface as GraphQL errors with the backend copy
- [ ] `definitions.ts` matches `graphql.go` by source-diff; no REST/MCP additions

## Out of scope

- The settings UI (t005)
