/harness-claude:graphql-apollo-serverfrom harness-claude
Configures and runs Apollo Server 4 with plugins, context, data sources, and framework integrations (Express, Fastify, standalone).
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:graphql-apollo-server still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Configure and run Apollo Server with plugins, context, data sources, and framework integrations
@apollo/server with the appropriate integration package.import { ApolloServer } from '@apollo/server';
import { expressMiddleware } from '@apollo/server/express4';
import express from 'express';
import cors from 'cors';
const app = express();
const server = new ApolloServer({ typeDefs, resolvers });
await server.start();
app.use(
'/graphql',
cors(),
express.json(),
expressMiddleware(server, {
context: async ({ req }) => ({
currentUser: await authenticate(req.headers.authorization),
}),
})
);
app.listen(4000);
Build the context object in the integration, not in ApolloServer. AS4 moved context creation to the framework integration layer. The context function receives the framework-specific request object.
Use plugins for cross-cutting concerns. Plugins hook into the request lifecycle — use them for logging, APM, caching, and error tracking instead of middleware.
const loggingPlugin: ApolloServerPlugin<Context> = {
async requestDidStart({ request }) {
const start = Date.now();
return {
async willSendResponse({ response }) {
const duration = Date.now() - start;
logger.info({ operationName: request.operationName, duration });
},
async didEncounterErrors({ errors }) {
errors.forEach((err) => logger.error(err));
},
};
},
};
const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [loggingPlugin],
});
import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled';
const server = new ApolloServer({
typeDefs,
resolvers,
introspection: process.env.NODE_ENV !== 'production',
plugins: [
process.env.NODE_ENV === 'production'
? ApolloServerPluginLandingPageDisabled()
: ApolloServerPluginLandingPageLocalDefault(),
],
});
class UserDataSource {
constructor(
private db: Database,
private loader: DataLoader<string, User>
) {}
async findById(id: string): Promise<User | null> {
return this.loader.load(id);
}
async create(input: CreateUserInput): Promise<User> {
const user = await this.db.users.insert(input);
this.loader.prime(user.id, user);
return user;
}
}
formatError to sanitize errors before sending to clients. Strip stack traces, internal messages, and sensitive data from error responses in production.const server = new ApolloServer({
typeDefs,
resolvers,
formatError: (formattedError, error) => {
if (process.env.NODE_ENV === 'production') {
delete formattedError.extensions?.stacktrace;
}
return formattedError;
},
});
Call server.start() before applying middleware. AS4 requires explicit startup. This validates the schema and initializes plugins before the server accepts requests.
Use server.stop() for graceful shutdown. Hook into process signals to drain in-flight requests before exiting.
const shutdown = async () => {
await server.stop();
process.exit(0);
};
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);
Apollo Server 3 to 4 migration: AS4 removes apollo-server-express in favor of @apollo/server + expressMiddleware. The constructor no longer accepts context — pass it to the integration. dataSources config is removed — create data sources in the context function. plugins and formatError remain on the constructor.
Plugin lifecycle hooks: serverWillStart, requestDidStart (returns per-request hooks: didResolveSource, didResolveOperation, responseForOperation, executionDidStart, willSendResponse, didEncounterErrors). Use the most specific hook for your use case.
Performance tuning:
@cacheControl directives for CDN-level cachingallowBatchedHttpRequests: true for client-side query batchingHealth checks: AS4 does not include a built-in health check endpoint. Add one in your framework layer: app.get('/health', (_, res) => res.sendStatus(200)).
CSRF prevention: AS4 includes CSRF prevention by default — it requires a non-empty Content-Type header or a custom header like Apollo-Require-Preflight. Do not disable this in production.
https://www.apollographql.com/docs/apollo-server/
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
apollo-server, graphql-api, server-setup, plugin-configuration
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job