apollo-client
Skill5k starsChanged yesterdayApache-2.0View on GitHub
Guide for building React applications with Apollo Client 4.x. Use this skill when: (1) setting up Apollo Client in a React project, (2) writing GraphQL queries or mutations with hooks, (3) configuring caching or cache policies, (4) managing local state with reactive variables, (5) troubleshooting Apollo Client errors or performance issues.
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 132
Always handle loading and error states in UI when using non-suspenseful hooks (useQuery, useLazyQuery).
- Very specific: line 133
Use fetchPolicy to control cache behavior per query
- Distinctive: line 134
Use the TypeScript type server to look up documentation for functions and options (Apollo Client has extensive docblocks)
- Distinctive: line 139
If the mutation response is insufficient, carefully weigh manual cache manipulation vs refetching.
- Very specific: line 141
Use refetchQueries sparingly (prefer letting the cache update automatically)
- Very specific: line 147
Use typePolicies for pagination and computed fields
- Distinctive: line 153
Avoid over-fetching with proper field selection
- Very specific: line 155
Use @defer for incremental delivery of deferred query parts, and @stream for streaming list fields (@stream available in Apollo Client 4.1+)
- Distinctive: line 160
ALWAYS use Apollo Client 4.x patterns (not v3 or earlier)
- Very specific: line 161
ALWAYS wrap your app with ApolloProvider
- Distinctive: line 162
ALWAYS handle loading and error states when using non-suspenseful hooks
- Very specific: line 163
PREFER Suspense hooks (useSuspenseQuery, useBackgroundQuery) in modern applications for better DX
- Distinctive: line 164
NEVER store Apollo Client in React state (use module-level or context)
- Very specific: line 165
PREFER cache-first for read-heavy data, network-only for real-time data
- Distinctive: line 166
USE TypeScript for better type safety with GraphQL
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Apollo Client 4.x Guide
Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Version 4.x brings improved caching, better TypeScript support, and React 19 compatibility.
Integration Guides
Choose the integration guide that matches your application setup:
- Client-Side Apps - For client-side React applications without SSR (Vite, Create React App, etc.)
- Next.js App Router - For Next.js applications using the App Router with React Server Components
- React Router Framework Mode - For React Router 7 applications with streaming SSR
- TanStack Start - For TanStack Start applications with modern routing
Each guide includes installation steps, configuration, and framework-specific patterns optimized for that environment.
Quick Reference
Basic Query
import { gql } from "@apollo/client";
import { useQuery } from "@apollo/client/react";
const GET_USER = gql`
query GetUser($id: ID!) {
user(id: $id) {
id
name
}
}
`;
function UserProfile({ userId }: { userId: string }) {
const { loading, error, data, dataState } = useQuery(GET_USER, {
variables: { id: userId },
});
if (loading) return <p>Loading...</p>;
if (error) return <p>Error: {error.message}</p>;
// TypeScript note: for stricter type narrowing, you can also check `dataState === "complete"` before accessing data
return <div>{data?.user.name}</div>;
}Basic Mutation
import { gql } from "@apollo/client";
import { useMutation } from "@apollo/client/react";
const CREATE_USER = gql`
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
}
}
`;
function CreateUserForm() {
const [createUser, { loading, error }] = useMutation(CREATE_USER);
const handleSubmit = async (name: string) => {
await createUser({ variables: { input: { name } } });
};
return <button onClick={() => handleSubmit("John")}>Create User</button>;
}Suspense Query
import { Suspense } from "react";
import { useSuspenseQuery } from "@apollo/client/react";
function UserProfile({ userId }: { userId: string }) {
const { data } = useSuspenseQuery(GET_USER, {
variables: { id: userId },
});
return <div>{data.user.name}</div>;
}
function App() {
return (
<Suspense fallback={<p>Loading user...</p>}>
<UserProfile userId="1" />
</Suspense>
);
}Reference Files
Detailed documentation for specific topics:
- TypeScript Code Generation - GraphQL Code Generator setup for type-safe operations
- Queries - useQuery, useLazyQuery, polling, refetching
- Suspense Hooks - useSuspenseQuery, useBackgroundQuery, useReadQuery, useLoadableQuery
- Mutations - useMutation, optimistic UI, cache updates
- Fragments - Fragment colocation, useFragment, useSuspenseFragment, data masking
- Caching - InMemoryCache, typePolicies, cache manipulation
- State Management - Reactive variables, local state
- Error Handling - Error policies, error links, retries
- Troubleshooting - Common issues and solutions
Key Rules
Query Best Practices
- Each page should generally only have one query, composed from colocated fragments. Use
useFragmentoruseSuspenseFragmentin all non-page-components. Use@deferto allow slow fields below the fold to stream in later and avoid blocking the page load. - Fragments are for colocation, not reuse. Each fragment should describe exactly the data needs of a specific component, not be shared across components for common fields. See Fragments reference for details on fragment colocation and data masking.
- Always handle
loadinganderrorstates in UI when using non-suspenseful hooks (useQuery,useLazyQuery). When using Suspense hooks (useSuspenseQuery,useBackgroundQuery), React handles this through<Suspense>boundaries and error boundaries. - Use
fetchPolicyto control cache behavior per query - Use the TypeScript type server to look up documentation for functions and options (Apollo Client has extensive docblocks)
Mutation Best Practices
- If the schema permits, mutation return values should return everything necessary to update the cache. Neither manual updates nor refetching should be necessary.
- If the mutation response is insufficient, carefully weigh manual cache manipulation vs refetching. Manual updates risk missing server logic. Consider optimistic updates with a granular refetch if needed.
- Handle errors gracefully in the UI
- Use
refetchQueriessparingly (prefer letting the cache update automatically)
Caching Best Practices
- Configure
keyFieldsfor types withoutidfield - Disable normalization by setting
keyFields: falsefor types that don't include an identifier and are meant to group related fields under the parent - Use
typePoliciesfor pagination and computed fields - Understand cache normalization to debug issues
- Enable data masking for all new applications - it prevents components from accessing fragment data they don't own, enforcing proper data boundaries and preventing over-rendering
Performance
- Avoid over-fetching with proper field selection
- Configure appropriate
fetchPolicyper use case - Use
@deferfor incremental delivery of deferred query parts, and@streamfor streaming list fields (@streamavailable in Apollo Client 4.1+) - Prefer Suspense hooks (
useSuspenseQuery,useBackgroundQuery) in modern applications for better loading state handling and code simplicity
Ground Rules
- ALWAYS use Apollo Client 4.x patterns (not v3 or earlier)
- ALWAYS wrap your app with
ApolloProvider - ALWAYS handle loading and error states when using non-suspenseful hooks
- PREFER Suspense hooks (
useSuspenseQuery,useBackgroundQuery) in modern applications for better DX - NEVER store Apollo Client in React state (use module-level or context)
- PREFER
cache-firstfor read-heavy data,network-onlyfor real-time data - USE TypeScript for better type safety with GraphQL
- IMPLEMENT proper cache updates instead of refetching entire queries
- ADVISE the human steering you to look into Apollo DevTools when collaboratively debugging Apollo Client issues
Trending
Less talk lately.about the whole repository
Who's talking about clidey/whodb
- A Hacker News story“Show HN: WhoDB – Streamlined, Lightweight Database Management with a Sleek UI/UX”Hacker News · Jul 1, 2024 · 37 points
- A Hacker News story“WhoDB: Lightweight next-gen database explorer”Hacker News · Jul 2, 2024 · 16 points
- A Hacker News story“Show HN: Open-source database CLI that doubles as an MCP server for agents”Hacker News · Apr 23, 2026 · 3 points
- @github-trending-js.bsky.social“📦 clidey / whodb ⭐ 3,619 (+81) 🗒 TypeScript A lightweight next-gen data explorer - Postgres, MySQL, …”Bluesky · Jul 20, 2025 · 3 likes
- @github-trending-js.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 clidey / whodb ⭐ 1,680 (+261) 🗒 TypeScript A lightweight next-gen …”Bluesky · Nov 8, 2024 · 3 likes
The biggest 5 of 60 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 60
Talked about on GitHub, Bluesky and Hacker News (60 times).
On GitHub · 50
- Oct 28, 2026agent-skills.github.clidey.whodb: 0.136.0 → 0.138.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026whodb-cli 0.138.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 21, 2026whodb-cli 0.136.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 21, 2026agent-skills.github.clidey.whodb: 0.135.0 → 0.136.0 — sudosubin/agents.nix0 reactions
- Oct 17, 2026whodb-cli: avoid prebuilt libbaml_cffi, restrict network access — Homebrew/homebrew-core0 reactions · 1 comment
45 more on GitHub
- Oct 15, 2026whodb-cli 0.135.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Oct 15, 2026agent-skills.github.clidey.whodb: 0.134.0 → 0.135.0 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.clidey.whodb: 0.129.0 → 0.134.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026whodb-cli 0.134.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 30, 2026Update https://github.com/advisories/GHSA-5pf6-cq2v-23ww to include patched version — github/advisory-database0 reactions
- Sep 28, 2026whodb-cli 0.131.0 — Homebrew/homebrew-core0 reactions · 2 comments
- Sep 26, 2026agent-skills.github.clidey.whodb: init at 0.129.0 — sudosubin/agents.nix0 reactions
- Sep 25, 2026whodb-cli 0.130.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 18, 2026whodb-cli 0.129.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Sep 18, 2026whodb-cli 0.128.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 21, 2026whodb-cli 0.127.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 21, 2026whodb-cli: rename binary to "whodb" from "whodb-cli"- #299878 — Homebrew/homebrew-core0 reactions · 13 comments
- Aug 20, 2026whodb-cli 0.126.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 13, 2026whodb-cli 0.125.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 10, 2026whodb-cli 0.124.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Aug 3, 2026whodb-cli 0.123.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 24, 2026whodb-cli 0.122.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 16, 2026whodb-cli 0.121.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 16, 2026docs: add WhoDB to showcase — wailsapp/wails0 reactions · 2 comments
- Jul 11, 2026whodb-cli 0.120.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jul 3, 2026whodb-cli 0.119.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 27, 2026whodb-cli 0.118.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 23, 2026whodb-cli 0.117.0 — Homebrew/homebrew-core0 reactions · 2 comments
- Jun 23, 2026whodb-cli 0.116.0 — Homebrew/homebrew-core0 reactions · 2 comments
- Jun 19, 2026whodb-cli 0.115.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 13, 2026whodb-cli 0.114.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Jun 4, 2026whodb-cli 0.113.0 — Homebrew/homebrew-core0 reactions · 1 comment
- May 27, 2026whodb-cli 0.112.0 — Homebrew/homebrew-core0 reactions · 1 comment
- May 20, 2026whodb-cli 0.111.0 — Homebrew/homebrew-core0 reactions · 1 comment
- May 15, 2026whodb-cli 0.110.0 — Homebrew/homebrew-core0 reactions · 1 comment
- May 9, 2026whodb-cli 0.109.0 — Homebrew/homebrew-core0 reactions · 1 comment
- May 2, 2026whodb-cli 0.107.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 15, 2026whodb-cli 0.106.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 10, 2026whodb-cli 0.105.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Apr 2, 2026whodb-cli 0.104.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 27, 2026whodb-cli 0.103.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 27, 2026whodb-cli 0.102.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 23, 2026whodb-cli 0.101.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 19, 2026whodb-cli 0.100.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 13, 2026whodb-cli 0.99.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 9, 2026whodb-cli 0.98.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 3, 2026whodb-cli 0.97.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Mar 3, 2026whodb-cli 0.96.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 26, 2026whodb-cli 0.95.0 — Homebrew/homebrew-core0 reactions · 1 comment
- Feb 19, 2026whodb-cli 0.94.0 — Homebrew/homebrew-core0 reactions · 1 comment
On Bluesky · 7
- Jul 20, 2025📦 clidey / whodb ⭐ 3,619 (+81) 🗒 TypeScript A lightweight next-gen data explorer - Postgres, MySQL, SQLite, MongoDB, Redis, MariaDB,… — @github-trending-js.bsky.social3 likes and reposts
- Nov 8, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 clidey / whodb ⭐ 1,680 (+261) 🗒 TypeScript A lightweight next-gen data explorer - Postgres, MySQL,… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- Feb 21, 2026次世代を謳うデータベース管理ツール。React+Go実装。無償版はPostgreSQL, MySQL, SQLite, MongoDB, Redis, Elasticsearchに対応。有償版は追加でOracle, MSSQL, DnymoDB, Athena,… — @matsuu.bsky.social2 likes and reposts
- Nov 7, 2024🔍 #WhoDB: A lightweight (20MB) #database management tool with #AI chat interface! Supports #PostgreSQL #MySQL #MongoDB & more. Built with… — @michabbb.bsky.social2 likes and reposts
- Apr 15, 2025clidey/whodb: A lightweight next-gen data explorer - Postgres, MySQL, SQLite, MongoDB, Redis, MariaDB, Elastic Search, and Clickhouse with… — @cjlise.eurosky.social1 likes and repost
2 more on Bluesky
- Jan 10, 2025clidey/whodb: A lightweight next-gen data explorer - Postgres, MySQL, SQLite, MongoDB, Redis, MariaDB, Elastic Search, and Clickhouse with… — @latitude77.bsky.social1 likes and repost
- Nov 11, 2024github.com/clidey/w... GitHub - clidey/whodb: A lightweight next-gen data explorer - Postgres, MySQL, SQLite, MongoDB, Redis, MariaDB &… — @technews4869.bsky.social1 likes and repost
On Hacker News · 3
- Jul 1, 2024Show HN: WhoDB – Streamlined, Lightweight Database Management with a Sleek UI/UX37 points · 5 comments
- Jul 2, 2024WhoDB: Lightweight next-gen database explorer16 points · 3 comments
- Apr 23, 2026Show HN: Open-source database CLI that doubles as an MCP server for agents3 points
Other versions1 project uses a version of this.
Word for word · 1
- apollographql/skills★ 123100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- apollo-mcp-serverSkill
- apollo-router-plugin-creatorSkill
- apollo-routerSkill
- apollo-serverSkill
- graphql-schemaSkill
- impeccableSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

