---
id: w5/m16/t003
title: Wire stepper to scaleService mutation
worker: worker5
status: done
estimate: 25m
depends_on: [w5/m16/t002]
---

## Objective

Wire the stepper to the `scaleService` GraphQL mutation (shipped in `w2/m12`), with loading state and error surfacing on rejection (e.g. out-of-bounds N).

## Context

- Mutation: `scaleService(id, numInstances)` — `lego/backend/internal/apps/graphql.go`.
- Apollo client patterns already established elsewhere in the dashboard (e.g. plan-picker mutation in m7).

## Steps

1. Add the `scaleService` mutation to the dashboard's GraphQL codegen inputs.
2. On submit, call the mutation; show a loading state on the stepper.
3. On error (e.g. backend 400 for out-of-bounds N), surface it inline near the stepper.

## Files

- `dashboard/src/routes/services.$serviceId.settings.tsx`
- GraphQL codegen fragments/mutations

## Acceptance criteria

- [ ] Submitting a valid count updates `replicas` and reflects it in the UI without a full reload.
- [ ] A rejected scale request surfaces a clear inline error.

## Out of scope

- Placement/type-aware hiding (t004).
