data-fetching

Implement fetch API, Axios, React Query, and SWR for network requests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cgasgarth/opencode-config --skill data-fetching-cgasgarth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-fetching
Source: https://github.com/cgasgarth/opencode-config/tree/main/skill/expo-app-design/skills/data-fetching
Command: npx skills add https://github.com/cgasgarth/opencode-config --skill data-fetching-cgasgarth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of making network requests, fetching data, and managing API interactions within your application, ensuring robust and efficient data handling.

Core Features & Use Cases

  • API Integration: Implement and debug any network request using fetch or libraries like React Query.
  • Data Management: Handle data fetching, caching strategies, and offline support seamlessly.
  • Use Case: Automatically fetch user data from an API endpoint, display it in a component, and implement caching so the data only refreshes every 5 minutes.

Quick Start

Use the data-fetching skill to fetch user data for a given user ID from the example API.

Frequently Asked Questions about data-fetching

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

FAQPage Schema
How do I implement caching for API data fetching in React?

API data fetching with caching can be implemented using React Query to manage network requests, control refresh intervals, and handle data retrieval seamlessly without redundant endpoint calls.

What's the best way to handle errors and offline support during network requests?

Handling errors and offline support during network requests involves implementing robust fallback logic within your data fetching layer to manage failed API calls and cache offline data.

How do I manage authentication tokens and environment variables for API endpoints?

Managing authentication tokens and environment variables for API endpoints requires configuring your data fetching operations to securely pass credentials and dynamically route network requests to the correct API.

Can I use SWR and Axios for data fetching instead of the fetch API?

Yes, you can use SWR and Axios for data fetching operations, as the approach covers implementation of various network request libraries alongside standard fetch API integrations for application data retrieval.

Why does my React Query data not refresh automatically?

React Query data fetching might not refresh automatically if the caching strategy is explicitly configured with a specific stale time, requiring manual refetching or adjusted refresh interval configurations.