agentleFS
salmandevsalmandev/everything-gemini/skills/graphql-architect/SKILL.md

graphql-architect

Skill2 starsChanged 28 days agoApache-2.0View on GitHub

Designs, specifies, and implements production GraphQL APIs, DataLoader N+1 query batching, Relay-style cursor pagination, and schema federation.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use deployment-engineer, technical-writer and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • belokonmSkill

    deployment-engineer

    Expert Deployment Engineer specializing in CI/CD automation, containerization, and release management across diverse platforms. Proficient in Jenkins, GitHub Actions, GitLab CI, Azure DevOps, and modern deployment strategies including blue-green deployments and canary releases.

    Also in 3 projects that use this

  • VercelSkill

    technical-writer

    Write, review, and edit developer documentation for SDKs, libraries, and frameworks, including sites such as ai-sdk.dev and chat-sdk.dev. Use for getting-started guides, tutorials, API references, conceptual explanations, integration guides, migration guides, troubleshooting, and code examples.

    Also in 3 projects that use this

  • CloudflareSkill

    receiving-code-review

    Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

    Also in 4 projects that use this

  • OpenAISkill

    requesting-code-review

    Use when completing tasks, implementing major features, or before merging to verify work meets requirements

    Also in 4 projects that use this

  • StrayDragonSkill

    ui-ux-pro-max

    UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never query database tables inside nested resolvers without a batching mechanism (e.g., DataLoader).

    line 17

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GraphQL Architecture & API Craftsmanship

This skill guides the design, schema modeling, query optimization, and implementation of production-grade GraphQL APIs.


1. Core Principles

  1. Schema-First Design:
    • Model client domain requirements into a declarative Schema Definition Language (SDL) before implementing resolvers.
  2. Defeat the N+1 Problem:
    • Never query database tables inside nested resolvers without a batching mechanism (e.g., DataLoader).
  3. Cursor-Based Pagination:
    • For real-time or dynamic lists, implement Relay-compliant cursor pagination (Connection, Edge, PageInfo) rather than offset/limit pagination.

2. Relay-Compliant Cursor Pagination Pattern

type PageInfo {
  hasNextPage: Boolean!
  hasPreviousPage: Boolean!
  startCursor: String
  endCursor: String
}

type UserEdge {
  cursor: String!
  node: User!
}

type UserConnection {
  edges: [UserEdge!]!
  pageInfo: PageInfo!
  totalCount: Int!
}

type Query {
  users(first: Int, after: String): UserConnection!
}

3. DataLoader Batching Blueprint

Prevent database query fan-out by batching IDs into a single SQL IN query per event loop tick:

import DataLoader from 'dataloader';

// Batch function loading users by array of IDs
const batchUsers = async (userIds: readonly string[]): Promise<(User | Error)[]> => {
  const users = await db.user.findMany({
    where: { id: { in: [...userIds] } },
  });
  
  // Map results back to exact input order
  const userMap = new Map(users.map(u => [u.id, u]));
  return userIds.map(id => userMap.get(id) || new Error(`User ${id} not found`));
};

export const createUserDataLoader = () => new DataLoader(batchUsers);

4. Query Complexity & Depth Limiting

To prevent Denial-of-Service attacks through cyclic or deeply nested queries:

  • Enforce maximum query depth (e.g., max 6 levels).
  • Assign cost multipliers to nested connections to reject queries exceeding complexity thresholds.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.