api-patterns

Select REST, GraphQL, or tRPC based on project data needs and client technology.

132|22|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/xenitV1/Antigravity-Workflows --skill api-patterns-xenitv1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-patterns
Source: https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/api-patterns
Command: npx skills add https://github.com/xenitV1/Antigravity-Workflows --skill api-patterns-xenitv1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides a structured approach to selecting the most appropriate API pattern (REST, GraphQL, or tRPC) based on project needs, team capabilities, and long-term maintenance goals.

Core Features & Use Cases

  • Framework for deciding between REST, GraphQL, and tRPC based on data complexity, frontend requirements, and versioning strategy.
  • Use Case: When designing a new service with multiple clients and evolving data schemas, select the pattern that balances flexibility, performance, and maintainability.
  • Use Case: For TS-backed monorepos, prefer tRPC to maximize type safety and end-to-end developer experience.

Quick Start

Start by outlining your API consumers, data access patterns, and front-end tech stack, then map these to the recommended API style and provide a rationale.

Frequently Asked Questions about api-patterns

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

FAQPage Schema
How do I choose between REST, GraphQL, and tRPC for my API?

REST, GraphQL, and tRPC each suit different needs. REST works well for simple, cacheable resources. GraphQL excels when clients need flexible data queries and schema evolution. tRPC maximizes type safety in TypeScript monorepos. Choose based on data complexity, client requirements, and your team's tech stack.

When should I use GraphQL instead of REST?

GraphQL suits projects with multiple clients, evolving data schemas, and complex data access patterns. Use it when clients need to fetch exactly the fields they require, reducing over-fetching and simplifying versioning compared to REST endpoints.

What are the advantages of tRPC for TypeScript projects?

tRPC provides end-to-end type safety between server and client in TypeScript monorepos, eliminating API contracts and schema drift. It reduces boilerplate and improves developer experience compared to REST or GraphQL for TS-backed applications.

Does API pattern choice affect long-term maintenance?

Yes. REST requires explicit versioning as schemas evolve. GraphQL enables schema flexibility without versioning. tRPC ties maintenance to your monorepo structure. Pattern selection directly impacts how maintainable your API remains as requirements change.

What should I consider before selecting an API pattern?

Map your API consumers, data access patterns, and front-end tech stack to each pattern. Consider data complexity, client diversity, team TypeScript expertise, performance needs, and how your schema will evolve to choose the pattern balancing flexibility, performance, and maintainability.