14 skills · 41 min
Skills
Skill 1 of 14
Guide for building React applications with Apollo Client 4.x.
3 minutes · 558 words · 13 sections
Install
npx skills add apollographql/skills --skill apollo-clientnpx skills add apollographql/skills/plugin marketplace add apollographql/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
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.
Choose the integration guide that matches your application setup:
Each guide includes installation steps, configuration, and framework-specific patterns optimized for that environment.
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
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
import { Suspense } from "react";
import { useSuspenseQuery } from "@apollo/client/react";
function UserProfile({ userId }: { userId: string }) {
const { data } = useSuspenseQuery(GET_USER, {
variables: { id: userId },
});
Detailed documentation for specific topics:
useFragment or useSuspenseFragment in all non-page-components. Use @defer to allow slow fields below the fold to stream in later and avoid blocking the page load.loading and error states in UI when using non-suspenseful hooks (useQuery, useLazyQuery). When using Suspense hooks (useSuspenseQuery, useBackgroundQuery), React handles this through <Suspense> boundaries and error boundaries.fetchPolicy to control cache behavior per queryrefetchQueries sparingly (prefer letting the cache update automatically)keyFields for types without id fieldkeyFields: false for types that don’t include an identifier and are meant to group related fields under the parenttypePolicies for pagination and computed fieldsfetchPolicy per use case@defer for incremental delivery of deferred query parts, and @stream for streaming list fields (@stream available in Apollo Client 4.1+)useSuspenseQuery, useBackgroundQuery) in modern applications for better loading state handling and code simplicityApolloProvideruseSuspenseQuery, useBackgroundQuery) in modern applications for better DXcache-first for read-heavy data, network-only for real-time dataGuide 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.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
Bash(npm:*)Bash(npx:*)Bash(node:*)ReadWriteEditGlobGrepskills/apollo-client/SKILL.mdmain, last pushed 23 September 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Apollo GraphQL, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./apollographql/skills.md, and each skill at its own URL..md13 files · 147 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 1.
Documentation the agent loads on demand, rather than up front.