/implement-graphql-api
Implement GraphQL API endpoints
$ npx -y skills add qdhenry/Claude-Command-Suite --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/implement-graphql-api
Context preview
What this command does when you run it.
Implement GraphQL API endpoints
Command definition
implement-graphql-api.mdImplement GraphQL API
Implement GraphQL API endpoints
Instructions
1. **GraphQL Setup and Configuration**
- Set up GraphQL server with Apollo Server or similar
- Configure schema-first or code-first approach
- Plan GraphQL architecture and data modeling
- Set up development tools and introspection
- Configure GraphQL playground and documentation
2. **Schema Definition and Type System**
- Define comprehensive GraphQL schema:
**Schema Definition (SDL):**
# schema/schema.graphql
# Scalar types
scalar DateTime
scalar EmailAddress
scalar PhoneNumber
scalar JSON
scalar Upload
# User types and enums
enum UserRole {
USER
ADMIN
MANAGER
}
enum UserStatus {
ACTIVE
INACTIVE
SUSPENDED
PENDING_VERIFICATION
}
type User {
id: ID!
email: EmailAddress!
username: String!
firstName: String!
lastName: String!
fullName: String!
phone: PhoneNumber
dateOfBirth: DateTime
avatar: String
role: UserRole!
status: UserStatus!
emailVerified: Boolean!
phoneVerified: Boolean!
profile: UserProfile
orders(
first: Int = 10
after: String
status: OrderStatus
): OrderConnection!
createdAt: DateTime!
updatedAt: DateTime!
lastLoginAt: DateTime
}
type UserProfile {
bio: String
website: String
location: String
timezone: String!
language: String!
notificationPreferences: JSON!
privacySettings: JSON!
}
# Product types
enum ProductStatus {
DRAFT
ACTIVE
INACTIVE
ARCHIVED
}
enum ProductVisibility {
VISIBLE
HIDDEN
CATALOG_ONLY
SEARCH_ONLY
}
type Product {
id: ID!
name: String!
slug: String!
sku: String!
description: String
shortDescription: String
price: Float!
comparePrice: Float
costPrice: Float
weight: Float
dimensions: ProductDimensions
category: Category
brand: Brand
vendor: Vendor
status: ProductStatus!
visibility: ProductVisibility!
inventoryTracking: Boolean!
inventoryQuantity: Int
lowStockThreshold: Int
allowBackorder: Boolean!
requiresShipping: Boolean!
isDigital: Boolean!
featured: Boolean!
tags: [String!]!
attributes: JSON!
images: [ProductImage!]!
variants: [ProductVariant!]!
reviews(
first: Int = 10
after: String
rating: Int
): ReviewConnection!
averageRating: Float
reviewCount: Int!
createdAt: DateTime!
updatedAt: DateTime!
publishedAt: DateTime
}
type ProductDimensions {
length: Float
width: Float
height: Float
unit: String!
}
type ProductImage {
id: ID!
url: String!
altText: String
sortOrder: Int!
}
type ProductVariant {
id: ID!
sku: String!
price: Float!
comparePrice: Float
inventoryQuantity: Int
attributes: JSON!
image: ProductImage
}
# Order types
enum OrderStatus {
PENDING
PROCESSING
SHIPPED
DELIVERED
CANCELLED
REFUNDED
ON_HOLD
}
type Order {
id: ID!
orderNumber: String!
user: User
status: OrderStatus!
currency: String!
subtotal: Float!
taxTotal: Float!
shippingTotal: Float!
discountTotal: Float!
total: Float!
billingAddress: Address!
shippingAddress: Address!
shippingMethod: String
trackingNumber: String
items: [OrderItem!]!
notes: String
createdAt: DateTime!
updatedAt: DateTime!
shippedAt: DateTime
deliveredAt: DateTime
}
type OrderItem {
id: ID!
product: Product!
productVariant: ProductVariant
quantity: Int!
unitPrice: Float!
totalPrice: Float!
productName: String!
productSku: String!
productAttributes: JSON
}
type Address {
firstName: String!
lastName: String!
company: String
addressLine1: String!
addressLine2: String
city: String!
state: String
postalCode: String!
country: String!
phone: PhoneNumber
}
# Connection types for pagination
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type UserEdge {
node: User!
cursor: String!
}
type ProductConnection {
edges: [ProductEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type ProductEdge {
node: Product!
cursor: String!
}
type OrderConnection {
edges: [OrderEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type OrderEdge {
node: Order!
cursor: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
# Input types
input CreateUserInput {
email: EmailAddress!
password: String!
firstName: String!
lastName: String!
phone: PhoneNumber
dateOfBirth: DateTime
role: UserRole = USER
}
input UpdateUserInput {
email: EmailAddress
firstName: String
lastName: String
phone: PhoneNumber
dateOfBirth: DateTime
status: UserStatus
}
input ProductFilters {
category: ID
brand: ID
priceMin: Float
priceMax: Float
status: ProductStatus
featured: Boolean
inStock: Boolean
tags: [String!]
search: String
}
input CreateProductInput {
name: String!
slug: String!
sku: String!
description: String
price: Float!
comparePrice: Float
categoryId: ID
brandId: ID
status: ProductStatus = DRAFT
inventoryQuantity: Int = 0
attributes: JSON
tags: [String!]
}
# Root types
type Query {
# User queries
me: User
user(id: ID!): User
users(
first: Int = 10
after: StringRead more
Implement GraphQL API
Implement GraphQL API endpoints
Instructions
1. **GraphQL Setup and Configuration**
- Set up GraphQL server with Apollo Server or similar
- Configure schema-first or code-first approach
- Plan GraphQL architecture and data modeling
- Set up development tools and introspection
- Configure GraphQL playground and documentation
2. **Schema Definition and Type System**
- Define comprehensive GraphQL schema:
**Schema Definition (SDL):**
# schema/schema.graphql
# Scalar types
scalar DateTime
scalar EmailAddress
scalar PhoneNumber
scalar JSON
scalar Upload
# User types and enums
enum UserRole {
USER
ADMIN
MANAGER
}
enum UserStatus {
ACTIVE
INACTIVE
SUSPENDED
PENDING_VERIFICATION
}
type User {
id: ID!
email: EmailAddress!
username: String!
firstName: String!
lastName: String!
fullName: String!
phone: PhoneNumber
dateOfBirth: DateTime
avatar: String
role: UserRole!
status: UserStatus!
emailVerified: Boolean!
phoneVerified: Boolean!
profile: UserProfile
orders(
first: Int = 10
after: String
status: OrderStatus
): OrderConnection!
createdAt: DateTime!
updatedAt: DateTime!
lastLoginAt: DateTime
}
type UserProfile {
bio: String
website: String
location: String
timezone: String!
language: String!
notificationPreferences: JSON!
privacySettings: JSON!
}
# Product types
enum ProductStatus {
DRAFT
ACTIVE
INACTIVE
ARCHIVED
}
enum ProductVisibility {
VISIBLE
HIDDEN
CATALOG_ONLY
SEARCH_ONLY
}
type Product {
id: ID!
name: String!
slug: String!
sku: String!
description: String
shortDescription: String
price: Float!
comparePrice: Float
costPrice: Float
weight: Float
dimensions: ProductDimensions
category: Category
brand: Brand
vendor: Vendor
status: ProductStatus!
visibility: ProductVisibility!
inventoryTracking: Boolean!
inventoryQuantity: Int
lowStockThreshold: Int
allowBackorder: Boolean!
requiresShipping: Boolean!
isDigital: Boolean!
featured: Boolean!
tags: [String!]!
attributes: JSON!
images: [ProductImage!]!
variants: [ProductVariant!]!
reviews(
first: Int = 10
after: String
rating: Int
): ReviewConnection!
averageRating: Float
reviewCount: Int!
createdAt: DateTime!
updatedAt: DateTime!
publishedAt: DateTime
}
type ProductDimensions {
length: Float
width: Float
height: Float
unit: String!
}
type ProductImage {
id: ID!
url: String!
altText: String
sortOrder: Int!
}
type ProductVariant {
id: ID!
sku: String!
price: Float!
comparePrice: Float
inventoryQuantity: Int
attributes: JSON!
image: ProductImage
}
# Order types
enum OrderStatus {
PENDING
PROCESSING
SHIPPED
DELIVERED
CANCELLED
REFUNDED
ON_HOLD
}
type Order {
id: ID!
orderNumber: String!
user: User
status: OrderStatus!
currency: String!
subtotal: Float!
taxTotal: Float!
shippingTotal: Float!
discountTotal: Float!
total: Float!
billingAddress: Address!
shippingAddress: Address!
shippingMethod: String
trackingNumber: String
items: [OrderItem!]!
notes: String
createdAt: DateTime!
updatedAt: DateTime!
shippedAt: DateTime
deliveredAt: DateTime
}
type OrderItem {
id: ID!
product: Product!
productVariant: ProductVariant
quantity: Int!
unitPrice: Float!
totalPrice: Float!
productName: String!
productSku: String!
productAttributes: JSON
}
type Address {
firstName: String!
lastName: String!
company: String
addressLine1: String!
addressLine2: String
city: String!
state: String
postalCode: String!
country: String!
phone: PhoneNumber
}
# Connection types for pagination
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type UserEdge {
node: User!
cursor: String!
}
type ProductConnection {
edges: [ProductEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type ProductEdge {
node: Product!
cursor: String!
}
type OrderConnection {
edges: [OrderEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type OrderEdge {
node: Order!
cursor: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
# Input types
input CreateUserInput {
email: EmailAddress!
password: String!
firstName: String!
lastName: String!
phone: PhoneNumber
dateOfBirth: DateTime
role: UserRole = USER
}
input UpdateUserInput {
email: EmailAddress
firstName: String
lastName: String
phone: PhoneNumber
dateOfBirth: DateTime
status: UserStatus
}
input ProductFilters {
category: ID
brand: ID
priceMin: Float
priceMax: Float
status: ProductStatus
featured: Boolean
inStock: Boolean
tags: [String!]
search: String
}
input CreateProductInput {
name: String!
slug: String!
sku: String!
description: String
price: Float!
comparePrice: Float
categoryId: ID
brandId: ID
status: ProductStatus = DRAFT
inventoryQuantity: Int = 0
attributes: JSON
tags: [String!]
}
# Root types
type Query {
# User queries
me: User
user(id: ID!): User
users(
first: Int = 10
after: StringA comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.
Repo: qdhenry/Claude-Command-Suite
Other commands on claude-command-suite.
- /boundary-bbcr-fallback
Execute automatic BBCR (Collapse-Rebirth Correction) when knowledge boundaries are exceeded or reasoning fails.
Open command - /boundary-detect
Analyze semantic position relative to knowledge boundaries to prevent hallucination and identify uncertainty zones.
Open command - /boundary-heatmap
Generate a visual heatmap of knowledge boundaries showing safe zones, risk areas, and semantic coverage.
Open command - /boundary-risk-assess
Evaluate the current risk level and provide detailed analysis of potential hallucination or reasoning failure.
Open command - /boundary-safe-bridge
Find and construct semantic bridges to safely navigate from current position to target concept without crossing dangerous boundaries.
Open command - /optimize-prompt
Takes an input prompt and returns ONLY a token-optimized version that preserves meaning while minimizing token count. Based on LLM tokenization principles: common words tokenize more efficiently, unusual words break into more tokens, and conciseness reduces cost.
Open command

