What problem does it solve?
GraphQL integration in React apps often relies on ad-hoc gql strings scattered across components and incomplete type safety. This Skill enforces a GraphQL-only discipline by centralizing operations in dedicated .graphql files and generating TypeScript typings from GraphQL Code Generator, ensuring UI uses typed documents rather than inline queries.
Core Features & Use Cases
- Centralized operation management: store all GraphQL documents under src/shared/api/graphql/operations/.
- Strong typing: generate TypeScript types and typed documents for useQuery/useMutation.
- Safe UI integration: avoid inline gql strings in components; changes propagate through codegen.
- Use Case: a frontend feature fetches user data with a typed query, mutation, and cache policies introduced via codegen.
Quick Start
Add a .graphql operation under src/shared/api/graphql/operations, run codegen to generate typed documents, and consume them with useQuery or useMutation in your UI code.