What problem does it solve?
Writing REST API integration code in React or TypeScript apps often means manually handling fetch calls, response parsing, cache updates, and type definitions. This Skill guides AI code generation to produce idiomatic @data-client/rest definitions so endpoints, resources, and mutations are type-safe and automatically normalized.
Core Features & Use Cases
- Resource Definitions: Generate CRUD resources with resource() covering GET, POST, PUT, PATCH, and DELETE with typed path parameters and searchParams.
- Custom Endpoints: Create standalone RestEndpoint instances with polling, optimistic responses, custom headers, and lifecycle overrides like parseResponse.
- Advanced Patterns: Handle pagination, optimistic updates, authentication headers, file downloads, and resource extension via .extend().
- Use Case: Ask the AI to model a JSONPlaceholder todos API and it produces a TodoResource with typed searchParams, pagination support, and optimistic mutations ready for useSuspense and controller.fetch calls.
Quick Start
Define a REST resource for the todos API at jsonplaceholder.typicode.com with typed search params and pagination using @data-client/rest.