---
name: Orval hook naming convention
description: How orval names generated React Query hooks — use grep to verify before writing frontend code.
---

Orval generates hook names based on the operationId in the OpenAPI spec, not the HTTP path. Examples:
- `GET /bookings` with operationId `listMyBookings` → `useListMyBookings`
- `GET /assets` with operationId `listAssets` → `useListAssets`
- `GET /network/members` with operationId `listNetworkMembers` → `useListNetworkMembers`
- `GET /admin/profiles` with operationId `adminListProfiles` → `useAdminListProfiles`
- `POST /admin/profiles` with operationId `adminCreateProfile` → `useAdminCreateProfile`

**Why:** Guessing hook names from paths leads to runtime errors ("module does not provide export named X"). Always grep `lib/api-client-react/src/generated/api.ts` for the actual export names before using them in pages.

**How to apply:** Before writing any `use*` import from `@workspace/api-client-react`, run `grep -n "export.*use" lib/api-client-react/src/generated/api.ts` to get the exact names.
