⚙️

GraphQL Schema from Requirements

Generate a complete GraphQL schema with resolvers from business requirements

Intermediate⚙️ BackendAll Models
prompt template
Design a GraphQL schema for this application:

**Domain:** [DOMAIN_DESCRIPTION — e.g., "project management tool with teams, projects, tasks, and comments"]
**Key operations:** [OPERATIONS — e.g., "CRUD for all entities, assign tasks, filter by status"]

Generate:
1. **Type definitions** — all GraphQL types with field descriptions
2. **Query root** — all queries with arguments and return types
3. **Mutation root** — all mutations with input types and responses
4. **Subscription root** — real-time subscriptions for relevant changes
5. **Connection pattern** — cursor-based pagination for lists
6. **Error handling** — union types for expected errors vs exceptions
7. **Authorization directives** — @auth, @hasRole for field-level access control
8. **N+1 prevention** — DataLoader patterns for nested resolvers

Output the complete .graphql schema file and resolver structure.

How to Use This Prompt

  1. 1Copy the prompt template above
  2. 2Paste into Claude, ChatGPT, or Cursor
  3. 3Replace [bracketed placeholders] with your specific project details
  4. 4Iterate on the AI output to refine and customize the results