09-data-fetching

Create a centralized typed HTTP layer with per-feature repositories.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/kennypallchizaca-coder/agentic-full-stack-skills --skill 09-data-fetching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 09-data-fetching
Source: https://github.com/kennypallchizaca-coder/agentic-full-stack-skills/tree/main/frontend-skills/09-data-fetching
Command: npx skills add https://github.com/kennypallchizaca-coder/agentic-full-stack-skills --skill 09-data-fetching

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Calling APIs directly from UI components leads to duplication, inconsistent error handling, and fragile authentication flows. This skill introduces a centralized, typed API layer with a single client and per-feature repositories to standardize data access, error handling, and testing across the app.

Core Features & Use Cases

  • Centralized API client configured from environment settings with base URL, timeout, and credentials behavior.
  • Per-feature repositories that map endpoints to strongly typed response interfaces, enabling safer composition and easier testing.
  • Resource-based loading with cancellation, retries, and built-in loading/error state across REST, GraphQL, or internal APIs.
  • Robust global error handling for 401/403 and server errors, plus tests to protect contracts and interceptor behavior.

Quick Start

Configure a shared API client from environment config and expose feature repositories with typed responses.

Frequently Asked Questions about 09-data-fetching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a centralized API client to standardize HTTP data fetching?

A centralized API client standardizes HTTP data fetching by configuring environment-based base URLs, timeouts, and safe credential handling to eliminate duplicated endpoint calls across UI components.

What is the best way to structure per-feature repositories for API responses?

Per-feature repositories map endpoints to strongly typed response interfaces, separating data access logic from UI components to enable safer composition and consistent REST or GraphQL data retrieval.

How do you handle API errors and authentication failures in a typed data layer?

A typed data layer handles API errors and authentication failures through global interceptors that map 401/403 and server errors, standardizing error handling and fragile authentication flows across the application.

Can I use this typed data layer for both REST and GraphQL endpoints?

Yes, the typed data layer supports REST, GraphQL, and internal endpoints by routing requests through a shared client while enforcing explicit response interfaces and resource-based loading for each feature.

How do I test API retry logic and request cancellation in HTTP repositories?

You test API retry logic and request cancellation by writing tests that cover interceptor behavior and resource-based loading states, protecting contracts and verifying error mapping within the feature repositories.