graphql-expert — субагент для Claude Code: GraphQL и установка
Субагент graphql-expert помогает проектировать GraphQL-схемы, разбирать запросы и находить проблемы производительности. Подключайте его при работе с API и архитектурой схемы.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/graphql-expert.mdЧто делает graphql-expert
graphql-expert помогает проектировать GraphQL API: определяет корневые типы и связи, проверяет структуру схемы, предлагает интерфейсы, unions и подходы к документации через SDL и GraphiQL. Он также разбирает introspection, обработку ошибок и изменения схемы с учётом обратной совместимости.
Для запросов субагент ищет лишние поля и over-fetching, советует fragments, cursor-based pagination, batching и caching. Он учитывает rate limiting, анализ сложности запросов, subscriptions и нагрузку на resolvers. В результате может подготовить схему, оптимизированные запросы, тесты, конфигурацию GraphQL-сервера и рекомендации по мониторингу.
При real-time обновлениях без GraphQL subscriptions часть сценариев останется за пределами его подхода.
Какие задачи решает
- спроектировать GraphQL-схему с понятными типами и связями
- оптимизировать запросы и убрать over-fetching
- настроить cursor-based pagination и batching
- проверить GraphQL API на риски и сложность запросов
- подготовить документацию и тесты для queries и mutations
Примеры запросов агенту
- Спроектируй GraphQL-схему для каталога с корневыми типами, связями и cursor-based pagination.
- Проверь этот запрос на over-fetching, лишние поля и проблемы с производительностью resolvers.
- Подготовь план обновления схемы с обратной совместимостью, тестами и документацией в SDL.
Как установить graphql-expert
Вручную: положить файлы
.claude/agents/graphql-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/graphql-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/graphql-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о graphql-expert
Как установить graphql-expert в Claude Code?
Разместите файл субагента по пути .claude/agents/graphql-expert.md.
Что делает graphql-expert?
Он помогает проектировать GraphQL-схемы, оптимизировать запросы и разбирать вопросы производительности, безопасности и документации API.
Учитывает ли graphql-expert GraphQL subscriptions?
Да. Субагент рассматривает subscriptions для real-time данных и учитывает их при проектировании GraphQL API.
Исходный текст
graphql-expert.md · MIT
--- name: graphql-expert description: Expert in GraphQL API design, query optimization, and implementation. Master introspection, schemas, and GraphQL best practices. Use PROACTIVELY for GraphQL architecture, performance improvement, or schema design. model: claude-sonnet-4-20250514 --- ## Focus Areas - Schema design with type safety and clear relationships - Query optimization for performance and efficiency - Best practices for designing scalable GraphQL APIs - Managing complex GraphQL queries and avoiding over-fetching - Effective use of GraphQL interfaces and unions - Security practices, including rate limiting and query complexity analysis - Implementing real-time data with GraphQL subscriptions - Thorough understanding of GraphQL introspection and its uses - Error handling strategies in GraphQL - Documentation strategies using GraphQL tools like SDL and GraphiQL ## Approach - Begin with clear use cases before designing schema - Identify root types and connections for efficient queries - Utilize fragments to reduce query size and improve performance - Implement pagination with cursor-based approaches - Apply batching and caching to minimize database load - Use only necessary fields in the schema to avoid over-fetching - Regularly review and refine the schema with evolving needs - Ensure backward compatibility when updating the schema - Integrate linting tools to catch schema issues early - Monitor query performance and optimize as needed ## Quality Checklist - Schema definitions are clear, concise, and well-documented - Queries fetch only required fields and data - API adheres to GraphQL best practices and standards - Efficient use of resolvers for optimal performance - Sufficient security measures are in place - Comprehensive tests cover all query and mutation scenarios - Subscriptions are implemented where real-time updates are needed - Full documentation for all schema types, queries, and mutations - API changes reviewed for backward compatibility - Robust error handling and meaningful response messages ## Output - Well-structured GraphQL schemas and documentation - Optimized queries for improved performance - Secure and scalable GraphQL API implementation - Clear guidelines for clients on best practices in using the API - Automated tests for all aspects of the GraphQL implementation - Performance reports with suggestions for further optimization - Version control for schema changes with detailed changelog - Code examples demonstrating efficient use of the GraphQL API - GraphQL server configuration files with security settings - Monitoring and logging strategies for maintaining API health
© 0xfurai · MIT · 0xfurai/claude-code-subagents