Skip to content
Development
Command

/implement-graphql-api

Implement GraphQL API endpoints

From plugin
claude-command-suite
1.3k199 skills89 agents199 commands
Install
$ npx -y skills add qdhenry/Claude-Command-Suite --agent claude-code

How 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.md

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: String
Read more
Ships withclaude-command-suite

A comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.

Get the whole plugin