apollo-server

Apollo Server configuration, plugins, caching, federation, and performance optimization.

509 stars

Best use case

apollo-server is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Apollo Server configuration, plugins, caching, federation, and performance optimization.

Teams using apollo-server should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/apollo-server/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/web-development/skills/apollo-server/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/apollo-server/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How apollo-server Compares

Feature / Agentapollo-serverStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Apollo Server configuration, plugins, caching, federation, and performance optimization.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Apollo Server Skill

Expert assistance for implementing GraphQL APIs with Apollo Server.

## Capabilities

- Configure Apollo Server with Express/Fastify
- Implement plugins for logging and metrics
- Set up caching strategies
- Build Apollo Federation gateways
- Handle authentication context
- Optimize performance with persisted queries

## Usage

Invoke this skill when you need to:
- Set up Apollo Server
- Implement caching
- Build federated services
- Add custom plugins
- Configure subscriptions

## Patterns

### Basic Setup

```typescript
import { ApolloServer } from '@apollo/server';
import { expressMiddleware } from '@apollo/server/express4';
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
import express from 'express';
import http from 'http';
import cors from 'cors';
import { typeDefs } from './schema';
import { resolvers } from './resolvers';
import { createContext } from './context';

async function startServer() {
  const app = express();
  const httpServer = http.createServer(app);

  const server = new ApolloServer({
    typeDefs,
    resolvers,
    plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
  });

  await server.start();

  app.use(
    '/graphql',
    cors(),
    express.json(),
    expressMiddleware(server, {
      context: createContext,
    })
  );

  await new Promise<void>((resolve) =>
    httpServer.listen({ port: 4000 }, resolve)
  );

  console.log('Server ready at http://localhost:4000/graphql');
}
```

### Context and Authentication

```typescript
import { PrismaClient } from '@prisma/client';
import jwt from 'jsonwebtoken';

const prisma = new PrismaClient();

export interface Context {
  prisma: PrismaClient;
  user: { id: string; role: string } | null;
}

export async function createContext({ req }): Promise<Context> {
  const token = req.headers.authorization?.replace('Bearer ', '');
  let user = null;

  if (token) {
    try {
      user = jwt.verify(token, process.env.JWT_SECRET!) as Context['user'];
    } catch {}
  }

  return { prisma, user };
}
```

## Best Practices

- Use plugins for cross-cutting concerns
- Implement proper error formatting
- Set up response caching
- Use DataLoader for batching

## Target Processes

- graphql-api-development
- apollo-federation
- api-development

Related Skills

react-server-components

509
from a5c-ai/babysitter

React Server Components patterns including streaming, data fetching, client/server component composition, and performance optimization.

api-mock-server

509
from a5c-ai/babysitter

Generate and run mock API servers from OpenAPI specifications

Language Server Protocol

509
from a5c-ai/babysitter

Expert skill for implementing Language Server Protocol servers with full IDE feature support

proxy-server

509
from a5c-ai/babysitter

Expert skill for proxy server implementation, configuration, and traffic interception

dedicated-server

509
from a5c-ai/babysitter

Dedicated server skill for deployment, scaling, and orchestration.

client-server

509
from a5c-ai/babysitter

Client-server architecture skill for authority models and validation.

apollo-prospecting

509
from a5c-ai/babysitter

Apollo.io prospecting and engagement data integration

process-builder

509
from a5c-ai/babysitter

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase workflow from research to implementation.

Workflow & Productivity

babysitter

509
from a5c-ai/babysitter

Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)

yolo

509
from a5c-ai/babysitter

Run Babysitter autonomously with minimal manual interruption.

user-install

509
from a5c-ai/babysitter

Install the user-level Babysitter Codex setup.

team-install

509
from a5c-ai/babysitter

Install the team-pinned Babysitter Codex workspace setup.