# GRAPHQL Schema

> Generates or reviews a GraphQL schema with types, queries, mutations, and resolvers

- Skill: `tomevault-io/graphql-schema-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/graphql-schema-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/graphql-schema-4/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/graphql-schema-4

---


## GraphQL Schema

Target: **$ARGUMENTS**

1. Detect GraphQL setup:
```bash
cat package.json | grep -E '"graphql"|"apollo-server"|"pothos"|"nexus"|"typegraphql"|"@graphql-yoga"'
ls src/graphql/ src/schema/ 2>/dev/null | head -10
```

2. If reviewing existing schema:
   - N+1 problem: resolvers fetching data per parent field
   - Missing `DataLoader` for batched queries
   - Over-exposed fields (internal IDs, timestamps that shouldn't be public)
   - Missing pagination (connections pattern)
   - Mutations not returning the updated entity

3. If generating new schema for `$ARGUMENTS`:

```graphql
type $ARGUMENTS {
  id: ID!
  # ... fields
  createdAt: DateTime!
  updatedAt: DateTime!
}

type Query {
  $ARGUMENTS(id: ID!): $ARGUMENTS
  ${ARGUMENTS}s(first: Int, after: String, filter: ${ARGUMENTS}Filter): ${ARGUMENTS}Connection!
}

type Mutation {
  create$ARGUMENTS(input: Create${ARGUMENTS}Input!): ${ARGUMENTS}MutationResult!
  update$ARGUMENTS(id: ID!, input: Update${ARGUMENTS}Input!): ${ARGUMENTS}MutationResult!
  delete$ARGUMENTS(id: ID!): Boolean!
}
```

4. Generate resolver stubs and DataLoader for the entity.

5. Add input validation and proper error types.

---
> Source: [berkcangumusisik/claude-code-practices](https://github.com/berkcangumusisik/claude-code-practices) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-15 -->

