# graphql-schema

The graphql-schema skill sets conventions for GraphQL queries, mutations, and type generation. It fits projects that use Apollo Client.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 6091 repo stars
- Author: ChrisWiles
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ChrisWiles/claude-code-showcase/tree/HEAD/.claude/skills/graphql-schema/SKILL.md
- Updated: 2026-01-06
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/chriswiles-graphql-schema

## What it does

The skill keeps GraphQL operations in separate `.gql` files and routes type generation through `npm run gql:typegen` or `npm run sync-types`. Application code should use the generated hooks rather than hand-written Apollo hooks. Generated output is treated as read-only.

Mutation guidance covers error callbacks, success feedback, loading indicators, and disabling the trigger while a request is active. It also lays out fragments, cache policies, conditional queries, polling, and optimistic updates. The examples connect these rules to React-style UI states.

If `npm run gql:typegen` is skipped after a `.gql` change, the generated hooks will remain out of date.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ChrisWiles/claude-code-showcase --skill graphql-schema -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/graphql-schema/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/graphql-schema/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ChrisWiles/claude-code-showcase --skill graphql-schema -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/graphql-schema/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ChrisWiles/claude-code-showcase --skill graphql-schema -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/graphql-schema/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ChrisWiles/claude-code-showcase .claude/skills/graphql-schema
```

2. **Manually: put the files in place**
- File: `.github/skills/graphql-schema/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ChrisWiles/claude-code-showcase --skill graphql-schema -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ChrisWiles/claude-code-showcase --path .claude/skills/graphql-schema
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/graphql-schema/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ChrisWiles/claude-code-showcase/tree/HEAD/.claude/skills/graphql-schema/SKILL.md

## When to use it
- move GraphQL operations into `.gql` files
- generate typed hooks from the schema
- handle mutation failures in the UI
- show loading and success states for submissions
- choose cache and optimistic-update behavior

## Example prompts
- Create a GraphQL item-list query in a separate `.gql` file and wire it through the generated hook.
- Add a create-record mutation with failure handling, success feedback, and a loading state.
- Tell me which code generation command to run after changing a `.gql` file, then update the generated types.

## Similar
- [react-graphql-apollo-client-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/react-graphql-apollo-client-cursorrules-prompt-file.md) — rule · ★ 41178 repo stars
- [graphql](https://affpapa.org/en/nevibecode/skills/bobmatnyc-graphql.md) — skill · 348 installs
- [graphql-operations](https://affpapa.org/en/nevibecode/skills/graphql-operations.md) — skill · 3900 installs
- [graphql-schema-designer](https://affpapa.org/en/nevibecode/skills/graphql-schema-designer.md) — skill · 230 installs
- [GraphQL API taste](https://affpapa.org/en/nevibecode/prompts/graphql-api-taste.md) — prompt · ★ 178201 repo stars
- [apollo-graphql](https://affpapa.org/en/nevibecode/skills/apollo-graphql.md) — skill · 718 installs

## Other versions with the same name
- [graphql-schema · apollographql](https://affpapa.org/en/nevibecode/skills/graphql-schema.md) — 4500 installs

From the same set: [chriswiles/claude-code-showcase](https://affpapa.org/en/nevibecode/by/chriswiles/claude-code-showcase.md) — 11 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
