Agent skill

Apollo Client

by apollographql in apollographql/skills

Guide for building React applications with Apollo Client 4.x.

MITAuto-check passedBackend & APIs

Install Apollo Client

skills CLI
$ npx skills add apollographql/skills --skill apollo-client -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install apollographql/skills apollo-client --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/apollographql/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/apollo-client .claude/skills/apollo-client && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
apollo-client
GitHub stars
117
Token cost
~1.9k tokens
SKILL.md length
598 words
Files
14 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Guide for building React applications with Apollo Client 4.x.

  • Setting up Apollo Client in a React project
  • SKILL.md covers Integration Guides, Quick Reference, Reference Files and Key Rules, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Writing GraphQL queries

What it does

Apollo Client is an agent skill from apollographql/skills. 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.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `references/caching.md`, `references/error-handling.md` and `references/fragments.md`). Compatibility notes: React 18+, React 19 (Suspense/RSC). Works with Next.js, Vite, CRA, and other React frameworks.

It sits in Backend & APIs, covering GraphQL and Caching. It works with Apollo GraphQL, React, GraphQL and Next.js. The repository describes itself as: Apollo GraphQL Agent Skills. The licence is MIT.

When your agent uses it

  • Setting up Apollo Client in a React project
  • Writing GraphQL queries
  • Mutations with hooks
  • Configuring caching

Example prompts

  • “/apollo-client”

Requirements

  • Compatibility (from SKILL.md): React 18+, React 19 (Suspense/RSC). Works with Next.js, Vite, CRA, and other React frameworks.
  • Pre-approved tools (allowed-tools): Bash(npm:*), Bash(npx:*), Bash(node:*), Read, Write, Edit, Glob, Grep

What it can do on your machine

Read from SKILL.md and the folder at commit 5f02fcf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(npm:*)
    • Bash(npx:*)
    • Bash(node:*)
    • Read
    • Write
    • Edit
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    React 18+, React 19 (Suspense/RSC). Works with Next.js, Vite, CRA, and other React frameworks.

    From compatibility in the SKILL.md frontmatter.

Context cost

Apollo Client loads about 1.9k tokens when it runs, and up to ~40k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 598 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~40k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from apollographql/skills at commit 5f02fcf, republished under its MIT licence (© apollographql). 598 words, ~1,856 tokens.

Download SKILL.mdSave it as .claude/skills/apollo-client/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
apollo-client
description
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.
allowed-tools
Bash(npm:*), Bash(npx:*), Bash(node:*), Read, Write, Edit, Glob, Grep
compatibility
React 18+, React 19 (Suspense/RSC). Works with Next.js, Vite, CRA, and other React frameworks.
license
MIT
metadata.author
apollographql
metadata.version
1.0.0

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:

Each guide includes installation steps, configuration, and framework-specific patterns optimized for that environment.

Quick Reference

Basic Query
tsx
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
tsx
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
tsx
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:

Key Rules

Query Best Practices
  • Each page should generally only have one query, composed from colocated fragments. Use 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.
  • 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 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.
  • Use fetchPolicy to 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 refetchQueries sparingly (prefer letting the cache update automatically)
Show full SKILL.md (212 more words)Show less
Caching Best Practices
  • Configure keyFields for types without id field
  • Disable normalization by setting keyFields: false for types that don't include an identifier and are meant to group related fields under the parent
  • Use typePolicies for 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 fetchPolicy per use case
  • Use @defer for incremental delivery of deferred query parts, and @stream for streaming list fields (@stream available 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-first for read-heavy data, network-only for 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

© apollographql, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (references) in skills/apollo-client of apollographql/skills.

  • SKILL.md
  • references/caching.md
  • references/error-handling.md
  • references/fragments.md
  • references/integration-client.md
  • references/integration-nextjs.md
  • references/integration-react-router.md
  • references/integration-tanstack-start.md
  • references/mutations.md
  • references/queries.md
  • references/state-management.md
  • references/suspense-hooks.md
  • references/troubleshooting.md
  • references/typescript-codegen.md

Open the folder on GitHubat commit 5f02fcf

Compare with similar skills

Apollo Client next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Apollo Client compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Apollo Client this skillapollographql/skills117—~1.9kAutomated safety check: PassMIT
Apollo GraphqlKilo-Org/kilo-marketplace1901 repos~3.1kAutomated safety check: PassApache-2.0
GraphQL Operations with CodegenChrisWiles/claude-code-showcase6.1k3 repos~1.5kAutomated safety check: PassNone
Ar Io Gateway Operatorar-io/ar-io-node127—~8.2kAutomated safety check: NotesAGPL-3.0
Wp Headless And Wpgraphqljorgerosal/wordpress-skills101—~1.7kAutomated safety check: PassMIT
Shopifyericrisco/rsc-harness167—~3.2kAutomated safety check: PassMIT

Similar skills

  • Apollo Graphql

    Kilo-Org/kilo-marketplace

    Guidelines for developing GraphQL APIs and React applications using Apollo Client for state management, data fetching, and caching

    190 GitHub starsUsed in 1 repo~3.1k tokens
    Backend & APIsAuto-check passed
  • GraphQL Operations with Codegen

    ChrisWiles/claude-code-showcase

    Sets the rules for writing GraphQL queries and mutations in .gql files, running codegen, and using generated Apollo hooks with proper error and loading handling.

    6.1k GitHub starsUsed in 3 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • Ar Io Gateway Operator

    ar-io/ar-io-node

    Operate any AR.IO node deployment — architecture, daily ops, diagnostics, and recurring pitfalls that apply to every operator.

    127 GitHub stars~8.2k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Wp Headless And Wpgraphql

    jorgerosal/wordpress-skills

    Headless WordPress and WPGraphQL review guidance. An agent skill from jorgerosal/wordpress-skills.

    101 GitHub stars~1.7k tokensUpdated 4 mo ago
    Backend & APIsAuto-check passed
  • Shopify

    ericrisco/rsc-harness

    A skill your agent uses when building or customizing a Shopify store across its three code surfaces — themes (Liquid, Online Store 2.0 sections, blocks and JSON templates), apps (Remix with the…

    167 GitHub stars~3.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Data Client Setup

    reactive/data-client

    Install and set up @data-client/react or @data-client/vue in a project.

    2k GitHub stars~2.2k tokensUpdated today
    MobileAuto-check passed

More from apollographql/skills

All 12 skills in this repo
  • Apollo Federation

    apollographql/skills

    Guide for authoring Apollo Federation subgraph schemas. An agent skill from apollographql/skills.

    117 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Apollo iOS

    apollographql/skills

    Guide for building Apple-platform applications with Apollo iOS, the strongly-typed GraphQL client for Swift.

    117 GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Graphos Factory

    apollographql/skills

    Build and iterate on an Apollo Connectors subgraph for a GraphOS supergraph from a REST API, with or without an OpenAPI or Swagger spec, in a dedicated git workspace that records what the API…

    117 GitHub stars~15k tokensUpdated today
    Auto-check passed
  • Graphql Operations

    apollographql/skills

    Guide for writing GraphQL operations (queries, mutations, fragments) following best practices.

    117 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Apollo Connectors

    apollographql/skills

    DEPRECATED: superseded by the graphos-factory skill (npx skills add apollographql/skills@graphos-factory), which builds and maintains a Connectors subgraph from a REST API with recorded decisions…

    117 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Apollo Router Plugin Creator

    apollographql/skills

    Guide for writing Apollo Router native Rust plugins. An agent skill from apollographql/skills.

    117 GitHub stars~4.1k tokensUpdated today
    Auto-check passed

Categories

Questions about Apollo Client

What does Apollo Client do?

Guide for building React applications with Apollo Client 4.x. Apollo Client is an agent skill from apollographql/skills.x.

When should I use Apollo Client?

Apollo Client fits situations like: setting up Apollo Client in a React project; writing GraphQL queries; mutations with hooks; configuring caching.

How do I install Apollo Client in Claude Code?

Run `npx skills add apollographql/skills --skill apollo-client -a claude-code`. Or copy the skill folder (skills/apollo-client in apollographql/skills) into .claude/skills/apollo-client in your project. Claude Code loads it when a task matches its description.

How do I install Apollo Client in Codex?

Run `npx skills add apollographql/skills --skill apollo-client -a codex`. Or copy the skill folder (skills/apollo-client in apollographql/skills) into .agents/skills/apollo-client in your project. Codex loads it when a task matches its description.

Can I use Apollo Client in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add apollographql/skills --skill apollo-client -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/apollo-client, .gemini/skills/apollo-client, .github/skills/apollo-client and .opencode/skills/apollo-client in your project.

What does Apollo Client need to run?

SKILL.md names no scripts, command-line tools or credentials: Apollo Client is instructions for the agent only. Its frontmatter pre-approves these tools: Bash(npm:*), Bash(npx:*), Bash(node:*), Read, Write, Edit, Glob, Grep. Compatibility (from SKILL.md): React 18+, React 19 (Suspense/RSC). Works with Next.js, Vite, CRA, and other React frameworks..

Does Apollo Client access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Apollo Client safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Apollo Client use?

Apollo Client is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Apollo Client use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 38k tokens, read only when the agent opens those files.

What are the alternatives to Apollo Client?

Skills that share tags, products or a category with Apollo Client: Apollo Graphql (Kilo-Org/kilo-marketplace, 190 stars), GraphQL Operations with Codegen (ChrisWiles/claude-code-showcase, 6.1k stars), Ar Io Gateway Operator (ar-io/ar-io-node, 127 stars) and Wp Headless And Wpgraphql (jorgerosal/wordpress-skills, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Apollo Client?

apollographql (a GitHub organization) maintains it in apollographql/skills, which has 117 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 7, 2026.

Source: apollographql/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.