Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

building-graphql-serverbuilding GraphQL server 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

727

周安装

30

GitHub Stars

2,114

下载量

238
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:building-graphql-server(building GraphQL server 文档)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/building-graphql-server
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill building-graphql-server
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill building-graphql-server

简介

用于构建生产级 GraphQL 服务端,支持 SDL-first 与 code-first 两种 Schema 设计模式。

  • 适用于 Node.js 与 Python 运行时,集成 Apollo Server、Strawberry 等主流框架。
  • 提供 DataLoader 批处理、WebSocket 订阅与字段级鉴权等企业级特性支持。
  • 安装使用 GitHub 仓库,需配置数据库 ORM 与 Redis 缓存等基础设施依赖项。
  • building-graphql-server 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Building GraphQL Server

Overview

Build production-ready GraphQL servers with SDL-first or code-first schema design, efficient resolver implementations with DataLoader batching, real-time subscriptions via WebSocket, and field-level authorization. Support Apollo Server, Yoga, Mercurius, and Strawberry across Node.js and Python runtimes.

Prerequisites

  • Node.js 18+ with Apollo Server/Yoga/Mercurius, or Python 3.10+ with Strawberry/Ariadne
  • Database with ORM (Prisma, TypeORM, SQLAlchemy) for resolver data sources
  • Redis for subscription pub/sub and DataLoader caching (production deployments)
  • GraphQL client for testing: GraphiQL, Apollo Studio, or Insomnia
  • graphql-codegen for TypeScript type generation from schema (recommended)

Instructions

  1. Examine existing data models, database schemas, and business requirements using Read and Glob to determine the entity graph and relationship structure.
  2. Design the GraphQL schema with type definitions, including Query, Mutation, and Subscription root types, input types for mutations, and connection types for paginated lists.
  3. Implement resolvers for each field, using DataLoader to batch and deduplicate database queries for nested relationships (N+1 query prevention).
  4. Add input validation on mutation arguments using custom scalars (DateTime, Email, URL) and directive-based validation (@constraint(minLength: 1, maxLength: 255)).
  5. Implement field-level authorization using schema directives (@auth(requires: ADMIN)) or resolver middleware that checks user roles from the GraphQL context.
  6. Configure query complexity analysis and depth limiting to prevent abusive queries (maximum depth of 7, maximum complexity score of 1000).
  7. Set up real-time subscriptions using graphql-ws protocol over WebSocket with Redis pub/sub for multi-instance message distribution.
  8. Generate TypeScript types from the schema using graphql-codegen to ensure type safety between schema definitions and resolver implementations.
  9. Write integration tests using executeOperation for query/mutation testing and WebSocket client tests for subscription verification.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/schema/ - GraphQL SDL type definitions organized by domain
  • ${CLAUDE_SKILL_DIR}/src/resolvers/ - Resolver implementations per type with DataLoader integration
  • ${CLAUDE_SKILL_DIR}/src/dataloaders/ - DataLoader factories for batched database queries
  • ${CLAUDE_SKILL_DIR}/src/directives/ - Custom schema directives (auth, validation, caching)
  • ${CLAUDE_SKILL_DIR}/src/scalars/ - Custom scalar type definitions (DateTime, JSON, Email)
  • ${CLAUDE_SKILL_DIR}/src/subscriptions/ - Subscription resolvers with pub/sub configuration
  • ${CLAUDE_SKILL_DIR}/generated/types.ts - Auto-generated TypeScript types from schema

Error Handling

ErrorCauseSolution
N+1 query detectedResolver fetches related records individually inside list resolverWrap data access in DataLoader; batch by parent ID array; cache within request scope
Query complexity exceededClient sends deeply nested query exceeding complexity budgetReturn error with current complexity score and maximum allowed; suggest query simplification
Subscription connection droppedWebSocket heartbeat timeout or network interruptionImplement automatic reconnection in client; use graphql-ws connectionInitWaitTimeout
Partial resolver failureOne field resolver throws while others succeedReturn partial data with errors array per GraphQL spec; log failed resolver with context
Schema stitching conflictDuplicate type names when merging multiple schema modulesUse schema namespacing or federation with @key directives to resolve type ownership

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

E-commerce product catalog: Schema with Product, Category, Review types, DataLoader-backed resolvers for nested queries like products {reviews {author}}, and a productUpdated subscription for inventory changes.

Multi-tenant SaaS dashboard: Code-first schema using TypeGraphQL decorators, tenant-scoped resolvers extracting tenantId from JWT context, and field-level visibility based on subscription plan tier.

Federated microservice graph: Apollo Federation with @key and @external directives across User, Order, and Product subgraphs, composed into a unified supergraph with a gateway router.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.55%
按下载量换算89

Claude

28.55%
按下载量换算68

Cursor

19.6%
按下载量换算47

Gemini CLI

9.76%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills