- Home
- Skills
- Martinholovsky
- Claude Skills Generator
- Graphql Expert
graphql-expert_skill
- Shell
25
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill martinholovsky/claude-skills-generator --skill graphql-expert- SKILL.md37.1 KB
Overview
This skill is an expert GraphQL developer persona focused on type-safe API development, schema design, resolver optimization, and federation architecture. It helps teams build secure, performant GraphQL services using schema-first patterns, DataLoader batching, and test-driven workflows. Use it to design schemas, implement Apollo-compatible servers, optimize queries, and design federated microservices.
How this skill works
The skill inspects your API goals and existing codebase, recommends schema-first designs, and provides concrete resolver implementations, batching patterns, and test scaffolding. It emphasizes TDD: produce failing tests first, implement minimal resolver logic to pass tests, then refactor. It enforces verification before producing any GraphQL config or code to avoid invented APIs or incorrect federation patterns.
When to use it
- Design or refactor GraphQL schemas with SDL and type safety
- Implement resolvers with DataLoader batching to avoid N+1 queries
- Set up Apollo Server (v4+) configurations and federation boundaries
- Add security controls: depth/complexity limits, field authorization, input validation
- Write integration and unit tests for queries and mutations
Best practices
- Start TDD: write failing tests for each resolver and integration before implementation
- Verify all GraphQL and Apollo Server APIs against official docs before coding or changing config
- Use schema-first design and generate TypeScript/Python types for end-to-end type safety
- Always implement DataLoader batching for relational fields to prevent N+1 queries
- Enforce query depth and complexity limits and disable introspection in production when appropriate
- Separate validation and error handling into reusable middleware and return structured error payloads
Example use cases
- Create a user query and resolver with context-based auth and DataLoader-backed user loading
- Implement createPost mutation with input validation, structured error responses, and unit tests
- Add query complexity and depth validators to Apollo Server startup to mitigate DOS risks
- Design a federated product/user graph with clear ownership and resolver contracts
- Refactor resolvers to extract validation, caching, and error middleware after tests pass
FAQ
I check official Apollo Server and GraphQL spec docs for any server configuration, directive, or federation syntax and verify DataLoader APIs. If certainty is below ~80%, I stop and cite sources.
How do you prevent N+1 queries?
I recommend DataLoader batching: implement a single batch function that fetches many keys in one database query and return results in request-scoped loaders stored in context.
How should I structure tests for resolvers?
Write failing integration/unit tests using your GraphQL execution helper (graphql/graphql_sync) and mock context (loaders, db, user). Implement minimal resolver logic to pass tests, then refactor.