Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Graphql?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-graphql)
---
name: graphql
description: GraphQL — schema design (nullability, connections, input types), resolvers and DataLoader batching against N+1, query cost and depth limits, persisted queries, authorization per field, federation, schema evolution and deprecation. Use for GraphQL schemas or servers (GraphQL, schema, resolver, DataLoader, federation, persisted queries).
metadata:
category: api
---
# GraphQL
## Purpose
Offer flexible data access without unbounded cost or authorization gaps.
**Use when:** clients need flexible, aggregated reads.
**Not for:** simple CRUD with one client.
## Inputs
- Client data needs, domain model.
## Outputs
- SDL schema, resolver design, cost limits, auth rules.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "graphql"` for prior decisions, patterns and anti-patterns.
- [API design standard](../../../standards/api-design.md)
## Steps
1. **Schema.** Design from client needs; connections for lists; explicit nullability.
Done when schema reviewed by consumers.
2. **Resolvers.** Batch with DataLoader per request.
Done when no N+1 in traces.
3. **Protection.** Depth and cost limits, persisted queries for public clients.
Done when expensive queries are rejected.
4. **Authz.** Authorize in the domain layer, not only at the gateway.
Done when field-level rules are tested.
## Best practices
- Deprecate fields with `@deprecated` before removal.
- Mutations return payload types with errors.
## Common mistakes
- Exposing the database schema 1:1.
- No query cost limits.
## Example
`orders(first, after)` connection with DataLoader for customers; max cost 1000; persisted queries for the mobile app.
## Reusable prompt
```text
Apply the GraphQL skill (.agents/skills/graphql/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design the schema, batching, cost limits and authorization rules for the GraphQL API.
Return: SDL schema, resolver design, cost limits, auth rules..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```