# graphql

Guides Claude Code in designing GraphQL schemas, batching database queries with DataLoader, and preventing nested query DoS attacks.

- skill · `type=skill` · Claude Code · 124 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/graphql
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/graphql

## What it does

This skill equips Claude Code with architecture rules for GraphQL APIs and frontend data fetching. It covers schema design, federation setups, and subscriptions. For client integrations, it handles urql and Apollo Client workflows alongside automated type generation via `graphql-codegen`.

A central focus is query protection and database efficiency. The instructions mandate DataLoader to batch operations instead of executing individual database calls per resolver. To stop denial-of-service traffic, it introduces query cost analysis and nesting depth limits. Relying solely on schema directives for authorization leaves the API exposed.

The guidance also covers deliberate nullability design so that an error in a nested field avoids wiping out parent records. It pairs directly with `backend`, `postgres-wizard`, `nextjs-app-router`, and `react-patterns`.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/graphql
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill graphql -a claude-code
```

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

### Codex

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

### Cursor

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates graphql
```

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

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/graphql
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/graphql/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/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/graphql

## When to use it
- eliminate N+1 database bottlenecks using DataLoader batching
- restrict query depth and computational complexity
- implement field-level permissions inside resolvers
- configure normalized caching in Apollo Client using type policies
- disable schema introspection on production deployments

## Example prompts
- Design a GraphQL schema for user profiles and add a DataLoader to batch post lookups.
- Set up query complexity analysis and depth limiting on this Apollo Server instance.
- Configure type policies for Apollo Client caching and generate types with graphql-codegen.

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

## Other versions with the same name
- [graphql · mindrally](https://affpapa.org/en/nevibecode/skills/mindrally-graphql.md) — 684 installs
- [graphql · bobmatnyc](https://affpapa.org/en/nevibecode/skills/bobmatnyc-graphql.md) — 331 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 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
