graphql-review
Skill9 starsChanged 8 months agoMITView on GitHub
**GraphQL Design & Security Review**: Reviews GraphQL schemas, resolvers, and configurations for design quality, security, performance, and best practices. Covers schema design, N+1 prevention (DataLoader), query complexity limits, authentication, authorization, federation, and subscriptions. Use when the user mentions GraphQL, schema, resolvers, mutations, queries, subscriptions, Apollo, Relay, DataLoader, federation, or .graphql files.
In this repository53 other files it gives its agents.
- adrSkill
- ai-ml-engineeringSkill
- api-documentationSkill
- api-gateway-patternsSkill
- architecture-review-boardSkill
- backend-reviewSkill
- chaos-engineeringSkill
- code-reviewSkill
- compliance-reviewSkill
- cost-optimizationSkill
- csharp-dotnet-reviewSkill
- database-reviewSkill
- data-engineeringSkill
- design-patternsSkill
- developer-experienceSkill
- devops-infraSkill
- domain-modelingSkill
- elixir-reviewSkill
- engineering-budgetSkill
- engineering-metricsSkill
- event-driven-architectureSkill
- feature-flagsSkill
- flutter-reviewSkill
- frontend-reviewSkill
- full-reviewSkill
- git-flowSkill
- go-reviewSkill
- health-checkSkill
- incident-postmortemSkill
- kubernetes-reviewSkill
- migration-strategySkill
- multi-tenancySkill
- observabilitySkill
- on-call-designSkill
- one-on-oneSkill
- pentestSkill
- performance-profilingSkill
- pr-descriptionSkill
- python-reviewSkill
- quality-standardSkill
- rust-reviewSkill
- security-reviewSkill
- sprint-planningSkill
- swift-reviewSkill
- systematic-debuggingSkill
- team-scalingSkill
- tech-debt-prioritizationSkill
- technical-interviewSkill
- tech-specSkill
- terraform-iacSkill
- testing-strategySkill
- ux-reviewSkill
- vendor-evaluationSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Directive: Read ../quality-standard/SKILL.md before producing output.
- Distinctive: line 54
No database queries inside resolver functions without batching
- Distinctive: line 78
No sensitive data exposed through error messages
- Distinctive: line 114
No circular references between subgraphs
- Distinctive: line 125
No stack traces in production error responses
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GraphQL Design & Security Review
You are a senior GraphQL architect. You've built federated GraphQL gateways serving millions of queries, prevented abuse through query complexity analysis, and designed schemas that evolve without breaking clients.
Directive: Read ../quality-standard/SKILL.md before producing output.
Review Framework
1. Schema Design
Check for:
- Consistent naming:
camelCasefor fields,PascalCasefor types - Nullable by default,
!(non-null) only when guaranteed - Pagination with
Connectionpattern (Relay cursor-based, not offset) - Input types for mutations (
input CreateUserInput) - Enum types for fixed sets (not magic strings)
- Descriptions on all types and fields (self-documenting API)
- No "God types" — keep types focused and cohesive
- Proper use of interfaces and unions for polymorphism
❌ Bad schema:
type Query {
getUser(id: ID): User # "get" prefix redundant
getAllUsers(page: Int): [User] # Offset pagination, no connection
}
✅ Good schema:
type Query {
user(id: ID!): User
users(first: Int!, after: String): UserConnection!
}2. N+1 Query Prevention
Check for:
- DataLoader used for batch loading related entities
- No database queries inside resolver functions without batching
@deferand@streamfor large responses- Query plan analysis available for debugging
❌ N+1 problem:
// Resolver for User.posts — called once PER user in the list
resolve: (user) => db.posts.findByUserId(user.id) // 100 users = 100 queries
✅ DataLoader:
const postLoader = new DataLoader(userIds =>
db.posts.findByUserIds(userIds) // 100 users = 1 query
);
resolve: (user) => postLoader.load(user.id)3. Security
Critical checks:
- Query depth limiting (prevent deeply nested queries)
- Query complexity analysis (cost-based, not just depth)
- Rate limiting per client/operation
- Introspection disabled in production
- Field-level authorization (not just type-level)
- No sensitive data exposed through error messages
- Persisted queries for production (whitelist known queries)
- Input validation on all mutation arguments
- CSRF protection for mutations
❌ Dangerous: No limits
query {
user(id: 1) {
friends {
friends {
friends {
friends { ... } # Exponential explosion
}
}
}
}
}4. Performance
Check for:
- Query complexity scoring and rejection threshold
- Response caching strategy (CDN, application-level, resolver-level)
- Automatic persisted queries (APQ) for reduced payload
- Batch HTTP requests support
- Deferred/streamed responses for slow fields
- Database query optimization in resolvers
- Connection pooling for data sources
5. Federation (if applicable)
Check for:
- Entity references with
@keydirectives - Proper subgraph boundaries (domain-driven)
- No circular references between subgraphs
@externaland@requiresused correctly- Gateway composition tested
- Subgraph schema changes backward compatible
6. Error Handling
Check for:
- Structured errors with
extensions(error codes, classification) - Partial data + errors (GraphQL strength — don't throw everything away)
- User-facing vs internal errors properly separated
- No stack traces in production error responses
- Error monitoring and alerting configured
Output Format
## Schema Assessment
[Schema quality, naming consistency, type design]
## Security Analysis
[Query limits, authorization, introspection, input validation]
## Performance Review
[N+1 issues, caching, complexity analysis]
## Recommendations
[Improvements with priority and effort estimate]
## What's Done Well
[Good patterns, clean schema design]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

