graphql
/graphql
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 integrat
- Author
- chrishuffman5 ↗
- Repository
- domain-expert ↗
- Licence
- MIT
- Last repository change
- 23.09.2026
Assessment and security
- Files in this package
- 5
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/01-schema-introspection-audit.sh
What it does and when to use it
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 integrat
Triggers from the description
Original author 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 integrat
How it works
- How to Approach Tasks
- Core Architecture
- Anti-Patterns
- Reference Files
- Cross-References
- Diagnostic Scripts
SKILL.md preview
---
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
Files in this package (5)
- SKILL.md 6 KB
- references/architecture.md 6 KB
- references/best-practices.md 7 KB
- references/diagnostics.md 8 KB
- scripts/01-schema-introspection-audit.sh 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · chrishuffman5/domain-expert | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
| crowdin/skills | 100 | MIT |
| claude-dev-suite/claude-dev-suite | 100 | MIT |
| lynricsy/hyperskills | 100 | MIT |
| muon-m2/magento2-tools | 100 | MIT |
| G1Joshi/Agent-Skills | 100 | MIT |
| arbazkhan971/godmode | 100 | MIT |
Database snapshot: 13.11.2026 · package version 95c184b5780d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100graphql-architect
Use when designing GraphQL schemas, implementing Apollo Federation, or building real-time subscriptions. Invoke for schema design, resolvers with DataLoader, query optimization, federation directives. - 100graphql-architect
Use when designing GraphQL schemas, implementing Apollo Federation, or building real-time subscriptions. Invoke for schema design, resolvers with DataLoader, query optimization, federation directives. - 95backend-graphql-optimization
Use this skill when the user says 'graphql n+1', 'dataloader', 'graphql slow', 'graphql performance', 'batch resolvers', 'query complexity', 'depth limit', 'persisted queries', 'graphql caching'. Diagnoses and fixes GraphQL server performance: N+1 resolver queries with… - 100graphql-expert
Expert-level GraphQL API development with schema design, resolvers, and subscriptions. Use when the user mentions API, apollo, schema, resolvers, subscriptions, or relay, or when the task involves Schema Design, Queries and Mutations, Apollo Server 4, or DataLoader for N+1 Prevention. - 86graphql-api-development
Use this skill when designing, implementing, or optimizing a GraphQL API: schema-first design, resolver architecture with DataLoader to prevent N+1 queries, mutation patterns with idempotency, real-time subscriptions, Apollo Federation for distributed graphs, security hardening… - 100graphql-schema-resolvers-apollo
Use this skill when designing GraphQL schemas, type definitions, resolvers, queries, mutations, and DataLoader caching layers.