Generate TanStack Query v5 useQuery or useMutation hooks for Lety 2.0 Frontend using the ApiSDK pattern. Triggered when the user needs to fetch data, create, update, or delete resources via the API.
You are generating a service hook for the Lety 2.0 Frontend (TanStack Query v5 + ApiSDK + TypeScript).
Priority rule: Always follow TanStack Query v5 docs and the project's ApiSDK pattern. Never use
axiosdirectly — always go throughApiSDK.getClient(). Never use.toPromise()— useasync/awaitinsidequeryFn/mutationFn.
features/<feature>/services/
get-<feature>.ts # useQuery hook
get-<feature>-list.ts # useQuery hook with pagination
create-<feature>.ts # useMutation hook
update-<feature>.ts # useMutation hook
delete-<feature>.ts # useMutation hook
ApiSDK singleton (src/shared/config/api-client.ts):
ApiSDK.getClient() — returns the auto-generated OpenAPI Axios client (async)Query defaults (set globally in root layout):
staleTime: 1000 * 60 * 3, // 3 minutes
gcTime: 1000 * 10 * 3, // 30 seconds