graphql-yoga
You are an expert in GraphQL Yoga, the batteries-included GraphQL server by The Guild. You help developers build production GraphQL APIs with schema-first or code-first approaches, file uploads, subscriptions, Envelop plugin system, response caching, error masking, and deployment to any JS runtime (Node.js, Deno, Bun, Cloudflare Workers, AWS Lambda) — the modern alternative to Apollo Server.
What this skill does
# GraphQL Yoga — Modern GraphQL Server
You are an expert in GraphQL Yoga, the batteries-included GraphQL server by The Guild. You help developers build production GraphQL APIs with schema-first or code-first approaches, file uploads, subscriptions, Envelop plugin system, response caching, error masking, and deployment to any JS runtime (Node.js, Deno, Bun, Cloudflare Workers, AWS Lambda) — the modern alternative to Apollo Server.
## Core Capabilities
### Server Setup
```typescript
import { createSchema, createYoga } from "graphql-yoga";
import { createServer } from "http";
const yoga = createYoga({
schema: createSchema({
typeDefs: `
type Query {
users(limit: Int, offset: Int): [User!]!
user(id: ID!): User
}
type Mutation {
createUser(input: CreateUserInput!): User!
updateUser(id: ID!, input: UpdateUserInput!): User!
}
type Subscription {
newUser: User!
}
type User {
id: ID!
name: String!
email: String!
posts: [Post!]!
createdAt: String!
}
type Post {
id: ID!
title: String!
author: User!
}
input CreateUserInput { name: String!, email: String! }
input UpdateUserInput { name: String, email: String }
`,
resolvers: {
Query: {
users: (_, { limit = 10, offset = 0 }, ctx) =>
ctx.db.users.findAll({ limit, offset }),
user: (_, { id }, ctx) => ctx.db.users.findById(id),
},
Mutation: {
createUser: async (_, { input }, ctx) => {
const user = await ctx.db.users.create(input);
ctx.pubsub.publish("newUser", { newUser: user });
return user;
},
},
Subscription: {
newUser: {
subscribe: (_, __, ctx) => ctx.pubsub.subscribe("newUser"),
},
},
User: {
posts: (user, _, ctx) => ctx.db.posts.findByAuthor(user.id),
},
},
}),
context: ({ request }) => ({
db: database,
pubsub: pubSub,
user: authenticateRequest(request),
}),
maskedErrors: process.env.NODE_ENV === "production",
cors: { origin: ["https://app.example.com"], credentials: true },
graphiql: process.env.NODE_ENV !== "production",
});
const server = createServer(yoga);
server.listen(4000, () => console.log("GraphQL on http://localhost:4000/graphql"));
```
### Envelop Plugins
```typescript
import { useResponseCache } from "@graphql-yoga/plugin-response-cache";
import { useRateLimiter } from "@graphql-yoga/plugin-rate-limiter";
import { useDepthLimit } from "envelop-depth-limit";
const yoga = createYoga({
schema,
plugins: [
useResponseCache({
session: (req) => req.headers.get("authorization"),
ttl: 60_000, // 60s cache
invalidateViaMutation: true,
}),
useRateLimiter({
identifyFn: (ctx) => ctx.user?.id || ctx.request.headers.get("x-forwarded-for"),
max: 100,
window: "1m",
}),
useDepthLimit({ maxDepth: 10 }),
],
});
```
## Installation
```bash
npm install graphql-yoga graphql
```
## Best Practices
1. **Envelop plugins** — Use the plugin system for auth, caching, rate limiting, logging; composable and reusable
2. **Response caching** — Enable response cache for public queries; cache by session for authenticated queries
3. **Depth limiting** — Set max query depth (10-15) to prevent abuse from deeply nested queries
4. **Error masking** — Enable in production; prevents leaking internal error details to clients
5. **Subscriptions** — Built-in SSE and WebSocket support; use PubSub for real-time updates
6. **File uploads** — Native multipart support; no extra libraries needed for file upload mutations
7. **Any runtime** — Deploy to Node.js, Deno, Bun, CF Workers, Lambda with the same code; runtime-agnostic
8. **DataLoader for N+1** — Use DataLoader in resolvers to batch database queries; prevents N+1 query problem
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.