rest-api

Fetch REST API data with TanStack Query and OpenTelemetry tracing.

3|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/guicheffer/devorch-cli --skill rest-api-guicheffer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rest-api
Source: https://github.com/guicheffer/devorch-cli/tree/main/templates/skills/data-access/rest-api
Command: npx skills add https://github.com/guicheffer/devorch-cli --skill rest-api-guicheffer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized and robust approach to fetching data from REST APIs, ensuring consistency, traceability, and efficient caching.

Core Features & Use Cases

  • Standardized Fetching: Uses TanStack Query with a custom useFetch hook for automatic OpenTelemetry tracing and request ID generation.
  • Efficient Caching: Implements hierarchical query keys for precise cache invalidation and optimized data retrieval.
  • Pagination: Supports infinite scroll pagination using useInfiniteQuery.
  • Use Case: When integrating with a third-party service that only offers a REST API, this Skill ensures your data fetching is as robust and observable as your internal GraphQL services.

Quick Start

Use the rest-api skill to fetch a list of products from the '/api/products' endpoint.

Frequently Asked Questions about rest-api

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

FAQPage Schema
How do I fetch REST API data reliably with caching and tracing?

Fetch REST API data reliably by standardizing requests with TanStack Query and OpenTelemetry tracing. This approach ensures cacheable, observable data retrieval from non-GraphQL endpoints, handling pagination and mutations consistently.

What's the best way to handle infinite scroll pagination for REST endpoints?

Handle infinite scroll pagination for REST endpoints using the useInfiniteQuery hook from TanStack Query. This provides efficient, cacheable data fetching while maintaining observable request tracing.

How does TanStack Query cache invalidation work for REST API data?

TanStack Query cache invalidation for REST API data uses hierarchical query keys. This structure allows precise cache invalidation and optimized data retrieval across your non-GraphQL service integrations.

Can I use OpenTelemetry tracing with TanStack Query for data fetching?

Yes, you can use OpenTelemetry tracing with TanStack Query through a custom useFetch hook. This integration automatically generates request IDs and traces REST API data fetching for enhanced observability.

When do I need a custom useFetch hook for REST API interactions?

You need a custom useFetch hook for REST API interactions when integrating with third-party services that lack GraphQL endpoints. It ensures your data fetching remains robust, traceable, and efficiently cached.