Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Graphql

ASecurity

GraphQL covering schema design, type system, execution model, Apollo Server/Client, Federation 2.x, Relay, DataLoader, persisted queries, subscriptions, and performance optimization. Use for \"GraphQL\", \"Apollo Server\", \"Apollo Client\", \"Federation\", \"subgraph\", \"supergraph\", \"DataLoader\", \"N+1\", \"schema design\", \"SDL\", \"resolver\", \"mutation\", \"subscription\", \"Relay\", \"Strawberry\", \"Hot Chocolate\", \"Mercurius\", \"graphql-yoga\", \"persisted queries\", \"intros...

4 stars
0 votes
0 copies
0 views
Added 9/24/2026
developmentpythongonodeexpressfastapidjangotestingapidatabasebackend

Works with

cliapi

Security Analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned 9/24/2026

$npx -y skills add chrishuffman5/domain-expert --skill graphql --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Graphql?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Graphql
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/chrishuffman5-graphql/badge)](https://www.skillsdirectory.com/skills/chrishuffman5-graphql)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: graphql
description: "GraphQL covering schema design, type system, execution model, Apollo Server/Client, Federation 2.x, Relay, DataLoader, persisted queries, subscriptions, and performance optimization. Use for \"GraphQL\", \"Apollo Server\", \"Apollo Client\", \"Federation\", \"subgraph\", \"supergraph\", \"DataLoader\", \"N+1\", \"schema design\", \"SDL\", \"resolver\", \"mutation\", \"subscription\", \"Relay\", \"Strawberry\", \"Hot Chocolate\", \"Mercurius\", \"graphql-yoga\", \"persisted queries\", \"introspection\", \"GraphQL Codegen\", \"Pothos\", \"TypeGraphQL\". Do NOT use for framework-specific integration details (e.g. wiring a resolver into an existing Express or Django app) — use the relevant framework skill in the `backend` plugin for that."
license: MIT
---

# GraphQL

This skill covers GraphQL, the query language for APIs. GraphQL is spec-based (October 2021 stable, with ongoing draft features). It has deep knowledge of:

- Type system (scalars, objects, interfaces, unions, enums, inputs)
- Execution model (parsing, validation, execution, null propagation)
- Schema design (schema-first vs code-first, Relay connections, input types)
- Server implementations (Apollo Server 5, Mercurius, graphql-yoga, Strawberry, Hot Chocolate)
- Apollo Client normalized cache, fetch policies, optimistic UI
- Federation 2.x (subgraphs, entity resolution, Rover CLI, Apollo Router)
- DataLoader pattern for N+1 prevention
- Subscriptions (WebSocket and SSE transport)
- Persisted queries, caching, and security hardening

## How to Approach Tasks

When you receive a request:

1. **Classify** the request:
   - **Schema design / type system** -- Load `references/architecture.md` for type system, execution model, schema patterns
   - **Performance / best practices** -- Load `references/best-practices.md` for DataLoader, caching, Federation, security, error handling
   - **Troubleshooting / diagnostics** -- Load `references/diagnostics.md` for N+1 queries, validation errors, cache issues, subscription problems
   - **Cross-protocol comparison** -- Read the `overview` skill for GraphQL vs REST, gRPC, etc.

2. **Gather context** -- Server library, client library, schema approach (SDL vs code-first), federation vs monolith, client platform

3. **Analyze** -- Apply GraphQL-specific reasoning. Consider schema evolution, query complexity, resolver architecture, and caching implications.

4. **Recommend** -- Provide actionable guidance with SDL snippets, resolver examples, and server configuration.

5. **Verify** -- Suggest validation steps (introspection queries, GraphQL Playground testing, Rover schema checks).

## Core Architecture

### Type System

Six named type kinds: Scalar (Int, Float, String, Boolean, ID + custom), Object, Interface, Union, Enum, Input. Wrapping types: Non-Null (`!`) and List (`[]`). Non-null on arguments means required.

### Execution Model

1. **Lexing** -- query string tokenized
2. **Parsing** -- tokens parsed into AST
3. **Validation** -- AST validated against schema (field existence, type compatibility, argument types)
4. **Execution** -- resolver tree traversed; sibling query fields resolve concurrently; root mutation fields execute serially

### Resolver Signature

```js
function resolver(parent, args, context, info) { }
```

`parent`: resolved value of parent field. `args`: field arguments. `context`: shared per-request (DB, loaders, user). `info`: field name, return type, schema, path.

### Schema-First vs Code-First

| Approach | Advantages | Libraries |
|---|---|---|
| Schema-first (SDL) | Readable contract, federation-compatible | graphql-tools, Apollo Server |
| Code-first | Type safety, single source of truth | Pothos, Nexus, TypeGraphQL, Strawberry, Hot Chocolate |

### Key Server Implementations

| Library | Language | Performance | Notes |
|---|---|---|---|
| Apollo Server 5 | Node.js | Standard | Most popular, rich plugin ecosystem |
| Mercurius | Node.js (Fastify) | 70,000+ req/s (JIT) | Highest throughput Node.js server |
| graphql-yoga | Node.js/Deno/Bun | ~10,900 req/s | Framework-agnostic, Fetch API |
| Strawberry | Python | Standard | Type hints, FastAPI integration |
| Hot Chocolate | .NET | High | Attributes, EF Core projections |

## Anti-Patterns

1. **Not using DataLoader** -- Every list with related fields needs DataLoader. Without it, N items cause N database queries.
2. **Sharing DataLoader across requests** -- DataLoaders must be per-request. Sharing causes stale data and security leaks.
3. **No query depth/complexity limits** -- A single deeply-nested query can bring down the server. Set limits in production.
4. **Introspection enabled in production** -- Unless required for tooling, disable introspection to prevent schema exposure.
5. **Mutations without input types** -- Use `input CreatePostInput` instead of individual arguments. Cleaner, more evolvable.
6. **Removing fields without deprecation** -- Use `@deprecated(reason: "...")` with a 90-180 day migration period before removal.
7. **N+1 via nested pagination** -- Paginated connections inside lists are especially vulnerable. Batch at the DataLoader level.
8. **Returning raw database errors** -- Sanitize errors. Use `extensions.code` for machine-readable error classification.

## Reference Files

- `references/architecture.md` -- Type system, execution model, schema design, Relay connections, Federation 2.x architecture, subscription model, server implementations
- `references/best-practices.md` -- DataLoader pattern, caching (APQ, normalized cache), Federation best practices, security hardening, error handling, schema evolution, performance tuning
- `references/diagnostics.md` -- N+1 detection, validation errors, null propagation issues, cache problems, subscription failures, Federation composition errors

## Cross-References

- `overview` skill -- cross-protocol comparisons
- `websocket` skill -- WebSocket transport for GraphQL subscriptions

## Diagnostic Scripts

Ready-made endpoint-audit script (read-only introspection) in `scripts/`.

- `scripts/01-schema-introspection-audit.sh` -- Introspection exposure check and schema surface review

Attribution

chrishuffman5chrishuffman5
View sourceSee grades on GitHubMore from chrishuffman5 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →