Build Graphql Server
Build a GraphQL server with schema-first design
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Build Graphql Server is
Build Graphql Server is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Build Graphql Server gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Build Graphql Server
Claude Code
- Download build-graphql-server.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/api-development/graphql-server-builder/commands/build-graphql-server.md, shared under the repository's MIT license. Read the full file on GitHub.
Create a production-ready GraphQL server with type-safe schemas, optimized resolvers, real-time subscriptions, authentication, and comprehensive tooling using schema-first design principles.
When to Use This Command
Use /build-graphql-server when you need to:
- Build flexible APIs with client-specified queries
- Implement real-time features with subscriptions
- Reduce over-fetching and under-fetching of data
- Create strongly-typed API contracts
- Support multiple client applications with different data needs
- Build microservices with federation support
DON'T use this when:
- Building simple CRUD APIs (REST may be simpler)
- Clients have limited GraphQL knowledge (learning curve)
- Caching is critical and simple (REST caching is more straightforward)
Design Decisions
This command implements Apollo Server with DataLoader as the primary approach because:
- Most mature GraphQL server implementation
- Excellent TypeScript support
- Built-in performance optimizations
- Rich ecosystem of tools and plugins
- Production-proven at scale
- Comprehensive monitoring with Apollo Studio
Alternative considered: GraphQL Yoga
- More lightweight and modular
- Better for serverless deployments
- Newer with smaller ecosystem
- Recommended for edge computing
Alternative considered: Mercurius (Fastify)
- Fastest GraphQL server
- Better for high-performance requirements
- Less mature ecosystem
- Recommended when performance is critical
Prerequisites
Before running this command:
- Define your domain models and relationships
- Choose database and ORM/ODM
- Plan authentication strategy
- Determine subscription requirements
- Identify performance requirements
Implementation Process
Step 1: Design GraphQL Schema
Create comprehensive type definitions with proper nullability and relationships.
Step 2: Implement Resolvers
Build efficient resolvers with DataLoader for batching and caching.
Step 3: Add Authentication & Authorization
Implement context-based auth with field-level permissions.
Step 4: Set Up Subscriptions
Configure WebSocket server for real-time updates.
Step 5: Optimize Performance
Add query complexity analysis, depth limiting, and caching.
Output Format
The command generates:
- schema/ - GraphQL schema definitions
- resolvers/ - Resolver implementations
- dataloaders/ - DataLoader configurations
- directives/ - Custom schema directives
- server.js - Apollo Server setup
- generated/types.ts - TypeScript definitions
- tests/ - Integration and unit tests
Code Examples
Example 1: Complete GraphQL Server with Apollo Server
// schema/schema.graphql
scalar DateTime
scalar Upload
directive @auth(requires: Role = USER) on FIELD_DEFINITION
directive @rateLimit(max: Int, window: String) on FIELD_DEFINITION
directive @deprecated(reason: String) on FIELD_DEFINITION | ENUM_VALUE
enum Role {
USER
MODERATOR
ADMIN
}
type User {
id: ID!
username: String!
email: String!
…Example 2: Optimized Resolvers with DataLoader
// resolvers/index.js
const { GraphQLScalarType } = require('graphql');
const { PubSub, withFilter } = require('graphql-subscriptions');
const DataLoader = require('dataloader');
const pubsub = new PubSub();
const resolvers = {
// Custom scalar for DateTime
DateTime: new GraphQLScalarType({
name: 'DateTime',
serialize: (value) => value.toISOString(),
parseValue: (value) => new Date(value),
parseLiteral: (ast) => new Date(ast.value)
}),
Query: {
me: async (_, __, { user, loaders }) => {
…Example 3: Custom Directives and Performance Optimization
// directives/auth.js
const { mapSchema, getDirective, MapperKind } = require('@graphql-tools/utils');
const { defaultFieldResolver } = require('graphql');
function authDirective(schema, directiveName) {
return mapSchema(schema, {
[MapperKind.OBJECT_FIELD]: (fieldConfig) => {
const authDirective = getDirective(schema, fieldConfig, directiveName)?.[0];
if (authDirective) {
const { requires } = authDirective;
const { resolve = defaultFieldResolver } = fieldConfig;
fieldConfig.resolve = async function (source, args, context, info) {
// Check if user is authenticated
if (!context.user) {
throw new Error('Not authenticated');
}
…Error Handling
Configuration Options
Server Options
- introspection: Enable schema introspection (disable in production)
- playground: Enable GraphQL Playground
- cors: CORS configuration
- uploads: File upload support
- subscriptions: WebSocket configuration
Performance Options
- depthLimit: Maximum query depth (default: 10)
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Build Graphql Server?
Build Graphql Server is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Build a GraphQL server with schema-first design
How do I install Build Graphql Server in Claude Code?
Download build-graphql-server.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Build Graphql Server in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Build Graphql Server safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Timezone Get current time, timezone info, and meeting scheduler for any location Slash Command · jeremylongshore/tons-of-skills-marketplace
- Threat Modeler Security threat modeling specialist that applies STRIDE to system architectures, identifies trust boundary risks, and produces prioritized mitigation plans with risk scores. Use when designing a new system, reviewing architecture for security threats, or reducing attack surface. Trigger with \"threat model\", \"security design review\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Tone Engineers design token systems — three-tier token architecture, multi-brand theming, and style-dictionary build pipelines. Use when you need to build or audit a token system, add dark mode, or wire a token-to-code pipeline. Trigger with \"design my token architecture\", \"audit my design tokens\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Track Position Track crypto positions with entry prices, current values, and PnL calculations Slash Command · jeremylongshore/tons-of-skills-marketplace
- Build Websocket Server Build WebSocket servers for real-time bidirectional communication Slash Command · jeremylongshore/tons-of-skills-marketplace
- Build Auth System Build comprehensive API authentication and authorization system Slash Command · jeremylongshore/tons-of-skills-marketplace
- Caching Implement multi-tier database caching with Redis, in-memory, and CDN layers Slash Command · jeremylongshore/tons-of-skills-marketplace
- Build Api Gateway Build production-ready API gateway with intelligent routing, authentication, Slash Command · jeremylongshore/tons-of-skills-marketplace