Design a GraphQL Schema
Generate a complete GraphQL schema with types, queries, mutations, subscriptions, and resolver signatures.
The Prompt
Design a GraphQL schema for the following application. Include: 1. All type definitions with fields and non-null annotations 2. Query type with all read operations 3. Mutation type with input types for write operations 4. Subscription type if real-time updates are needed 5. Custom scalars if needed (Date, JSON, etc.) 6. Pagination using Relay-style cursor-based connections 7. Resolver function signatures (not implementations) Application description: [DESCRIBE YOUR APPLICATION — e.g., A task management app where users have projects, projects have tasks with assignees and labels, and users can subscribe to real-time task status updates] Output the schema in GraphQL SDL format.
Example Output
Defined types for User, Project, Task, Label, and Comment with Relay-style TaskConnection/TaskEdge pagination, a createTask mutation accepting a CreateTaskInput type, and a taskUpdated subscription filtered by projectId. Used a custom Date scalar for timestamp fields.
FAQ
Which AI model is best for Design a GraphQL Schema?
GPT-4o or Claude Sonnet 4. Both have strong GraphQL knowledge.
How do I use the Design a GraphQL Schema prompt?
Copy the prompt, replace the [BRACKETED] placeholders with your specific information, and paste into your preferred AI assistant (ChatGPT, Claude, Gemini, etc.). Defined types for User, Project, Task, Label, and Comment with Relay-style TaskConnection/TaskEdge pagination, a createTask mutation accepting a CreateTaskInput type, and a taskUpdated subscription filtered by projectId. Used a custom Date scalar for timestamp fields.
Model Recommendation
GPT-4o or Claude Sonnet 4. Both have strong GraphQL knowledge.