What problem does it solve?
Setting up a GraphQL data layer with proper authentication, error handling, and typed queries requires repetitive boilerplate. This Skill configures @data-client/graphql so your GraphQL endpoint, queries, and mutations work with Reactive Data Client's caching and React hooks out of the box.
Core Features & Use Cases
- GQLEndpoint Configuration: Create a configured GQLEndpoint instance with sync or async authentication headers, including token refresh patterns.
- Custom Error Handling: Extend GQLEndpoint to intercept GraphQL errors such as UNAUTHENTICATED responses and dispatch auth events.
- Query and Mutation Definitions: Define typed GraphQL queries and mutations bound to Entity schemas and Collections, then consume them in components via useSuspense and useController.
- Use Case: After detecting GraphQL patterns in a project, install @data-client/graphql, create src/api/gql.ts with Bearer token auth, and define a getUser query plus an updateUser mutation wired to a User schema.
Quick Start
Set up @data-client/graphql in my project with a GQLEndpoint that uses Bearer token authentication and define a query and mutation for my User entity.