---
id: w5/m12/t002
title: GraphQL documents + hooks + `local-bex` stub fixtures for KV
worker: worker5
status: done
estimate: 45m
depends_on: [w5/m12/t001]
---

## Objective

The data layer: GraphQL documents for the w2/m7 KV operations (list/get/create/delete/connection-info, suspend/resume), codegen, Apollo hooks mirroring `features/databases/hooks/`, and `local-bex` stub fixtures serving 1–2 KV stores so every page builds and verifies offline.

## Context

- `dashboard/src/features/databases/{api,hooks}/` is the template (m8).
- Operation names come from w2/m7's GraphQL adapter (t005 there, sourced from the Render dashboard capture) — bind to those, don't invent.
- Stub: `dashboard/scripts/local-bex.mjs`, extended per the w5/m10 multi-service store pattern (per-id lookup, unknown → null).

## Steps

1. Add `features/keyvalue/api/*.graphql` + run codegen.
2. Hooks: list/get/create/delete/connection-info (+ suspend/resume) with cache updates on mutation.
3. Stub fixtures: an `available` store with connection info and a `creating` one.

## Files

- `dashboard/src/features/keyvalue/{api,hooks,types.ts}` (new)
- `dashboard/scripts/local-bex.mjs`

## Acceptance criteria

- [ ] Codegen clean; hooks typecheck; stub serves the operations with per-id resolution.
- [ ] `yarn lint && yarn typecheck` green.

## Out of scope

- Pages/components (t003–t005).
