Use when implementing GraphQL client patterns.
Scanned 9/10/2026
Install to Claude Code
npx -y skills add LoopyLuci/Skills --skill graphql-client-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Graphql Client Patterns?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/loopyluci-graphql-client-patterns)More formats (shields.io, HTML) on the badges page.
---
name: graphql-client-patterns
description: "Use when implementing GraphQL client patterns."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
hermes:
tags: [graphql, client, Apollo, Relay, queries, mutations, subscriptions, caching]
related_skills: [graphql-api-implementation, api-testing-patterns, frontend-bootstrap, caching-strategies]
---
# GraphQL Client Patterns
Implementing GraphQL client patterns — from query composition and fragment management through Apollo/Relay client setup, caching, optimistic updates, and pagination.
## When to Use
- Building frontend apps that consume GraphQL APIs
- Managing GraphQL queries, mutations, and subscriptions
- Implementing client-side caching and optimistic UI
- Handling pagination (cursor, offset, infinite scroll)
- Type-safe GraphQL operations with codegen
## Client Patterns
```python
CLIENT_PATTERNS = {
'fragments': 'Reusable field selections that compose into queries',
'pagination': 'Relay-style cursor pagination vs offset-based',
'optimistic_update': 'Immediately update UI before server confirms mutation',
'subscriptions': 'WebSocket-based real-time updates for live data',
'normalized_cache': 'Apollo/Relay cache normalizes by __typename + id',
}
# Apollo Client setup (React)
APOLLO_SETUP = """
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client';
const client = new ApolloClient({
link: createHttpLink({ uri: '/graphql' }),
cache: new InMemoryCache({
typePolicies: {
Query: {
fields: {
posts: {
merge(existing, incoming) {
return incoming;
}
}
}
}
}
})
});
"""
```
## Verification Checklist
- [ ] Fragments used for reusable field selections
- [ ] Pagination strategy chosen (cursor or offset)
- [ ] Client cache configured (normalized, type policies)
- [ ] Optimistic updates for key mutations (create, update)
- [ ] Error handling for failed operations (network, GraphQL errors)
- [ ] Type-safe (GraphQL Codegen)
- [ ] Subscriptions with reconnection logic
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!