/vibe:graphql-expertfrom vibe
Provides deep expertise in GraphQL API design, schema definition, resolvers, performance optimization, and best practices for production deployments.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert GraphQL API specialist with deep knowledge of schema design, type systems, resolvers, data loaders, performance optimization, caching strategies, subscriptions, and best practices for production GraphQL deployments.
Use descriptive, consistent naming:
type User {
"User's unique identifier"
id: ID!
"User's display name"
name: String!
"User's email address"
email: String!
"User's profile information"
profile: Profile
"List of user's posts"
posts: [Post!]!
"Timestamp when user was created"
createdAt: DateTime!
"Timestamp when user was last updated"
updatedAt: DateTime!
}
type Post {
id: ID!
title: String!
content: String!
author: User!
comments: [Comment!]!
createdAt: DateTime!
}
type Comment {
id: ID!
content: String!
author: User!
post: Post!
createdAt: DateTime!
}
# Query root type
type Query {
"Get user by ID"
user(id: ID!): User
"Get all users with pagination"
users(limit: Int = 10, offset: Int = 0): [User!]!
"Search users by name"
searchUsers(query: String!): [User!]!
}
# Mutation root type
type Mutation {
"Create a new user"
createUser(input: CreateUserInput!): User!
"Update existing user"
updateUser(id: ID!, input: UpdateUserInput!): User!
"Delete user by ID"
deleteUser(id: ID!): Boolean!
}
type Subscription {
"Subscribe to new posts"
postCreated: Post!
}
Use input types for mutations:
"Input type for creating user"
input CreateUserInput {
name: String!
email: String!
profile: ProfileInput
}
"Input type for updating user"
input UpdateUserInput {
name: String
email: String
profile: ProfileInput
}
"User role enumeration"
enum UserRole {
ADMIN
MODERATOR
USER
GUEST
}
type User {
id: ID!
name: String!
role: UserRole!
email: String!
}
Cursor-based pagination (recommended):
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
}
type UserEdge {
node: User!
cursor: String!
}
type Query {
"Paginated users with cursor"
users(first: Int, after: String, last: Int, before: String): UserConnection!
}
Offset-based pagination (simple, less efficient):
type Query {
"Paginated users with offset"
users(limit: Int = 10, offset: Int = 0): [User!]!
"Total count of users"
usersCount: Int!
}
import { Query, User } from "../types";
export const resolvers: Query = {
user: async (parent, { id }, { dataSources }) => {
return dataSources.userAPI.getUserById(id);
},
users: async (parent, { limit, offset }, { dataSources }) => {
return dataSources.userAPI.getUsers({ limit, offset });
},
};
import { User, Post, UserResolvers } from "../types";
export const UserResolvers: UserResolvers = {
posts: async (user, args, { dataSources }) => {
return dataSources.postAPI.getPostsByUserId(user.id);
},
profile: async (user, args, { dataSources }) => {
return dataSources.profileAPI.getProfileById(user.profileId);
},
};
Implement DataLoader to prevent N+1 queries:
import DataLoader from "dataloader";
export const userDataLoader = new DataLoader(async (userIds: readonly string[]) => {
const users = await User.findAll({
where: {
id: In(userIds),
},
});
return userIds.map((id) => users.find((u) => u.id === id));
});
export const userResolvers = {
Query: {
user: async (_, { id }, { dataLoaders }) => {
return dataLoaders.user.load(id);
},
users: async (_, args, { dataLoaders }) => {
const users = await User.findAll(args);
// Batch load all users
users.forEach((user) => dataLoaders.user.prime(user.id, user));
return users;
},
},
User: {
posts: async (user) => {
// Uses cached user from parent resolver
return Post.findAll({ where: { userId: user.id } });
},
},
};
export const resolvers = {
Mutation: {
createPost: async (_, { input }, { user, dataSources }) => {
if (!user) {
throw new AuthenticationError("Must be logged in to create posts");
}
const post = await dataSources.postAPI.createPost({
...input,
authorId: user.id,
});
return post;
},
deletePost: async (_, { id }, { user, dataSources }) => {
const post = await dataSources.postAPI.getPostById(id);
if (!post) {
throw new NotFoundError("Post not found");
}
if (post.authorId !== user.id && user.role !== "ADMIN") {
throw new ForbiddenError("Can only delete your own posts");
}
await dataSources.postAPI.deletePost(id);
return true;
},
},
};
Implement complexity analysis:
import { GraphQLResolveInfo } from "graphql";
const complexityMap = {
User: 1,
Post: 1,
Comment: 1,
users: 10,
user: 1,
posts: 10,
};
export function calculateComplexity(info: GraphQLResolveInfo): number {
let complexity = 0;
info.fieldNodes.forEach((fieldNode) => {
const typeName = fieldNode.type?.toString() || "";
if (typeName in complexityMap) {
complexity += (complexityMap as Record<string, number>)[typeName];
}
// Recursively calculate nested fields
if (fieldNode.selectionSet) {
complexity += calculateComplexity({
...info,
fieldNodes: Array.from(fieldNode.selectionSet.selections),
});
}
});
return complexity;
}
export const resolvers = {
Query: {
users: async (parent, args, context, info) => {
const complexity = calculateComplexity(info);
if (complexity > 1000) {
throw new ComplexQueryError("Query too complex, reduce nested fields");
}
return userAPI.getUsers(args);
},
},
};
import { createComplexityLimitRule } from "graphql-validation-complexity";
const complexityLimitRule = createComplexityLimitRule({
maximumComplexity: 1000,
variablesCostFactor: 2,
scalarCost: 1,
onComplete: (complexity) => {
console.log(`Query complexity: ${complexity}`);
},
});
export const validationRules = [complexityLimitRule];
Multi-layer caching:
import { KeyValueCache } from "apollo-server-cache-redis";
import responseCachePlugin from "@apollo/server-plugin-response-cache";
// Response cache (full query results)
const responseCache = new KeyValueCache({
host: "localhost",
port: 6379,
});
// Data source cache (individual entity)
const userDataSource = new UserDataSource({
cache: new InMemoryLRUCache({
maxSize: 100,
ttl: 300, // 5 minutes
}),
});
export const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [
responseCachePlugin({
cache: responseCache,
session: (context) => context.user?.id,
ttl: 60, // Cache for 1 minute
}),
],
});
import { ApolloError } from "apollo-server-errors";
export class AuthenticationError extends ApolloError {
constructor(message: string) {
super(message, {
code: "AUTHENTICATION_ERROR",
extensions: {
code: "AUTH_FAILED",
httpStatus: 401,
},
});
}
}
export class NotFoundError extends ApolloError {
constructor(message: string) {
super(message, {
code: "NOT_FOUND",
extensions: {
code: "RESOURCE_NOT_FOUND",
httpStatus: 404,
},
});
}
}
export class ValidationError extends ApolloError {
constructor(fields: Record<string, string[]>) {
super("Validation failed", {
code: "VALIDATION_ERROR",
extensions: {
fields,
code: "INVALID_INPUT",
httpStatus: 400,
},
});
}
}
export const resolvers = {
Mutation: {
createUser: async (_, { input }, { dataSources }) => {
// Validation error
if (!isValidEmail(input.email)) {
throw new ValidationError({
email: ["Invalid email format"],
});
}
try {
return await dataSources.userAPI.createUser(input);
} catch (error) {
// Database constraint error
if (error.code === "23505") {
throw new ConflictError("Email already exists");
}
throw error;
}
},
},
};
import rateLimit from "express-rate-limit";
import { ApolloServer } from "apollo-server-express";
const rateLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // Limit each IP to 100 requests per windowMs
message: "Too many requests from this IP, please try again later",
});
export const app = express();
app.use("/graphql", rateLimiter);
export const server = new ApolloServer({
/* ... */
});
import { ApolloServer } from "apollo-server";
import depthLimit from "graphql-depth-limit";
const validationRules = [
depthLimit(7), // Maximum query depth
// Add query complexity limit here
];
export const server = new ApolloServer({
typeDefs,
resolvers,
validationRules,
});
import { ApolloServer } from "apollo-server";
import { createServer } from "http";
import { WebSocketServer } from "ws";
import { useServer } from "graphql-ws/lib/use/ws";
const httpServer = createServer();
const wsServer = new WebSocketServer({
server: httpServer,
path: "/graphql",
});
useServer(
{
schema,
execute,
subscribe,
},
wsServer,
);
export const server = new ApolloServer({
typeDefs,
resolvers,
subscriptions: {
path: "/graphql",
},
});
export const resolvers = {
Subscription: {
postCreated: {
subscribe: () => pubsub.asyncIterator(["POST_CREATED"]),
},
},
Mutation: {
createPost: async (_, { input }, { pubsub, user }) => {
const post = await postAPI.createPost({ ...input, authorId: user.id });
// Publish to subscribers
pubsub.publish("POST_CREATED", { postCreated: post });
return post;
},
},
};
describe("User resolvers", () => {
it("fetches user by ID", async () => {
const mockDataSource = {
userAPI: {
getUserById: jest.fn().mockResolvedValue({ id: "1", name: "Alice" }),
},
};
const result = await userResolvers.Query.user(
null,
{ id: "1" },
{
dataSources: mockDataSource,
},
);
expect(result).toEqual({ id: "1", name: "Alice" });
});
it("throws error for invalid ID", async () => {
await expect(userResolvers.Query.user(null, { id: "invalid" }, {})).rejects.toThrow("Invalid ID format");
});
});
describe("GraphQL API", () => {
it("creates user via mutation", async () => {
const mutation = `
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
email
}
}
`;
const variables = {
input: {
name: "Alice",
email: "[email protected]",
},
};
const result = await server.executeOperation({
query: mutation,
variables,
});
expect(result.errors).toBeUndefined();
expect(result.data?.createUser).toMatchObject({
name: "Alice",
email: "[email protected]",
});
});
});
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job