pn-graphql

pn-graphql is a skill for Cursor from perniemann/pnCore. It costs 41 tokens per session (1,366 once invoked), scanned A, original, MIT.

A guide to building GraphQL APIs, where clients request the specific data they need through a typed schema.

In plain words
What is it for?
Use it when designing schemas, writing resolvers, mutations, subscriptions, or GraphQL Federation services.
Why use it?
It helps prevent slow repeated database queries, overly expensive nested requests, accidental exposure of internal data, and unclear schema design.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it when designing schemas, writing resolvers, mutations, subscriptions, or GraphQL Federation services.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-graphql
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add perniemann/pnCore --skill pn-graphql
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pn-graphql

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-graphql/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-graphql)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-graphql"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-graphql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pn-graphql

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-graphql"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-graphql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01366
Opus 5 $0.00020 $0.00683
Sonnet 5 $0.00008 $0.00273
Haiku 4.5 $0.00004 $0.00137

Measured 5d ago against content hash 54f8becc9b78, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

pn-graphql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pn-core-mcp/content/skills/backend/pn-graphql/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GraphQL

When to use

  • Designing or implementing a GraphQL API (schema-first or code-first)
  • Writing resolvers, mutations, or subscriptions
  • Reviewing a GraphQL schema for N+1 problems, over-fetching, or security issues
  • Setting up Apollo Server, GraphQL Yoga, or Pothos
  • Adding GraphQL Federation (supergraph / subgraph split)

Core principles

  1. Schema is the contract — design the schema from the consumer's perspective, not the database shape.
  2. Solve N+1 before shipping — every list resolver that calls a data source must use DataLoader or a batch-aware fetcher.
  3. Depth and complexity limits are non-negotiable — unprotected GraphQL endpoints are trivially DoS-able via nested queries.
  4. Mutations are commands, not CRUD — name mutations after business operations (placeOrder, cancelSubscription) not database verbs (updateOrder).
  5. Never expose internal IDs — use opaque cursor-based pagination and global IDs (node(id: "User:123")).

Schema design

# Use clear domain language; avoid database column names as field names
type User {
  id: ID!
  email: String!
  displayName: String!
  orders(first: Int, after: String): OrderConnection!
  createdAt: DateTime!
}

type OrderConnection {
  edges: [OrderEdge!]!
  pageInfo: PageInfo!
  totalCount: Int!
}

type OrderEdge {
  cursor: String!
  node: Order!
}

# Errors as values — union return types for mutations
type PlaceOrderResult {
  order: Order
  error: PlaceOrderError
}

enum PlaceOrderError {
  INSUFFICIENT_INVENTORY
  PAYMENT_DECLINED
  INVALID_ADDRESS
}

Resolvers (Apollo Server / GraphQL Yoga)

import { ApolloServer } from "@apollo/server";
import DataLoader from "dataloader";

// Batch loader — resolves N users in one query
const userLoader = new DataLoader<string, User>(async (ids) => {
  const users = await db.user.findMany({ where: { id: { in: [...ids] } } });
  return ids.map((id) => users.find((u) => u.id === id) ?? new Error(`User ${id} not found`));
});

const resolvers = {
  Query: {
    user: (_: unknown, { id }: { id: string }, { loaders }: Context) =>
      loaders.user.load(id),
  },
  Order: {
    // Field resolver — batched via DataLoader, not N+1
    customer: (order: Order, _: unknown, { loaders }: Context) =>
      loaders.user.load(order.customerId),
  },
  Mutation: {
    placeOrder: async (_: unknown, args: PlaceOrderInput, { user }: Context) => {
      if (!user) throw new GraphQLError("Unauthorized", { extensions: { code: "UNAUTHENTICATED" } });
      // business logic
    },
  },
};

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 178 lines · 41 tokens per session scan A 54f8becc9b78

Subscribe to this mod's changes

pn-graphql is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 1,366 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

architecture-patterns

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or…

wshobson/agents · 65 tokens

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

chat-sdk

Build multi-platform chat bots with Chat SDK (chat npm package). Use when developers want to (1) Build a Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, or WhatsApp bot, (2) Use Chat SDK to handle mentions, direct messages, subscribed threads, reactions, slash commands, cards, modals, files, or AI…

vercel-labs/open-agents · 191 tokens

developing-genkit-tooling

Best practices for authoring Genkit tooling, including CLI commands and MCP server tools. Covers naming conventions, architectural patterns, and consistency guidelines.

genkit-ai/genkit · 35 tokens

ax-go-flow

Use when writing Go code with github.com/ax-llm/ax/packages/go for flows, nodes, program graphs, nested programs, dynamic options, caching, and optimizer components.

ax-llm/ax · 43 tokens

output-dev-workflow-cost

Calculate and display the cost of an Output SDK workflow execution run. Use when checking LLM token costs, API service costs, or total spend for a specific workflow run.

growthxai/output · 40 tokens