agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/graphql-schema-design/SKILL.md

graphql-schema-design

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Design and review GraphQL schemas for authz, pagination, N+1 risk,

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer additive evolution.

    line 55
  2. Distinctive:

    Do not put secrets in GraphQL types that any authorized client can query casually without field authz.

    line 57
  3. Distinctive:

    Document error handling conventions (union vs exceptions).

    line 59
  4. Distinctive:

    If SDL is incomplete, state assumptions about resolvers.

    line 60
  5. Distinctive:

    File uploads: not always native; call out alternatives.

    line 66

“Common” is measured: kept by at least 6 in 10 of the 3 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 Schema Design

Schema is the product contract. Optimize for client clarity, server efficiency, and safe evolution.

Workflow

  1. Clarify clients, auth model, and write vs read paths.
  2. Model types and relationships; avoid leaking DB tables blindly.
  3. Specify nullability deliberately (every ! is a promise).
  4. Pagination: connections/cursors for lists that can grow.
  5. Authz: field and object level; never rely on "hidden" fields alone.
  6. Evolution: deprecations, additive changes, versioning policy.
  7. Performance: N+1, dataloader, query depth/cost limits.

Output format

## GraphQL design: <api>

### Type overview
…

### Queries / mutations
…

### Authz notes
…

### Pagination & errors
…

### Risks (N+1, breaking changes)
…

### Example operations

Rules

  1. Prefer additive evolution; mark breaking changes explicitly.
  2. Mutations should return clear payloads (errors, viewer, mutated entity).
  3. Do not put secrets in GraphQL types that any authorized client can query casually without field authz.
  4. Lists without bounds need pagination or hard limits.
  5. Document error handling conventions (union vs exceptions).
  6. If SDL is incomplete, state assumptions about resolvers.

Edge cases

  • Subscriptions: auth, fan-out cost, filtering.
  • Federation: ownership boundaries and shared types.
  • File uploads: not always native; call out alternatives.

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.