Design a GraphQL API for [APPLICATION TYPE].
Core entities: [LIST]
Key operations: [LIST]
Provide:
1. **Schema Definition**: Complete SDL with types, queries, mutations, subscriptions
2. **Input Types**: Validated inputs for all mutations
3. **Connection Types**: Cursor-based pagination (Relay-style)
4. **Resolvers**: Implementation for all queries and mutations
5. **DataLoader Setup**: Batch loading to solve N+1 queries
6. **Authentication Middleware**: Context-based auth with role permissions
7. **Error Handling**: Custom error types and codes
8. **Caching Strategy**: Field-level caching directives
9. **Testing**: Query examples and resolver unit tests
10. **Documentation**: Auto-generated docs setup with GraphQL Playground/Apollo Studio
Design a GraphQL API for [APPLICATION TYPE].
Core entities: [LIST]
Key operations: [LIST]
Provide:
1. **Schema Definition**: Complete SDL with types, queries, mutations, subscriptions
2. **Input Types**: Validated inputs for all mutations
3. **Connection Types**: Cursor-based pagination (Relay-style)
4. **Resolvers**: Implementation for all queries and mutations
5. **DataLoader Setup**: Batch loading to solve N+1 queries
6. **Authentication Middleware**: Context-based auth with role permissions
7. **Error Handling**: Custom error types and codes
8. **Caching Strategy**: Field-level caching directives
9. **Testing**: Query examples and resolver unit tests
10. **Documentation**: Auto-generated docs setup with GraphQL Playground/Apollo Studio
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.