graphql-schema-designerlisted
Install: claude install-skill RMAzrim/opencode-artes
# GraphQL Schema Designer
## Prerequisites & Dependencies
- Node.js 18+ with npm or pnpm
- GraphQL tooling: `npm i graphql` and `npm i -D graphql-cli` for validation
- Optional: `npm i @apollo/server` for Node 16+ server setup, or `npm i express-graphql` for Express integration
- Text editor with GraphQL schema syntax highlighting
## Execution Steps
1. Define the root-level schema using SDL (Schema Definition Language): type `Query`, `Mutation`, and custom types
2. Create scalar types or enums for constrained domains (e.g., `Status: PENDING | ACTIVE | ARCHIVED`)
3. Design `Query` type with fields that fetch single records or lists, using arguments for filtering/pagination
4. Design `Mutation` type for create, update, and delete operations, specifying input types via `input` blocks
4. Write resolver skeleton code that delegates to data sources (databases, APIs, in-memory stores)
5. Add pagination support using `connection` pattern or `first/last` + `after/before` cursor arguments
6. Validate the schema: `graphql schema validate schema.graphql` or integrate with Apollo Studio
7. Generate resolver boilerplate and wire it to the Apollo Server or Express middleware
```graphql
# schema.graphql
type Query {
hello: String
user(id: ID!): User
posts(
first: Int
after: String
): PostConnection
}
type Mutation {
createPost(input: CreatePostInput!): Post
updatePostStatus(id: ID!, status: Status!): Post
}
input CreatePostInput {
title: String!
content: String!