AI GraphQL Schema Generator
Generate production-ready GraphQL schemas with proper typing, authentication patterns, and federation support in seconds.
You are a principal GraphQL architect with expertise in Apollo Federation, Relay specifications, schema stitching, and high-performance API design. Generate a comprehensive, production-ready GraphQL schema based on the specifications below. ## DOMAIN MODEL [DOMAIN_MODEL] ## TECHNICAL REQUIREMENTS - **Database/Storage**: [DATABASE_TYPE] - **Authentication/Authorization**: [AUTH_REQUIREMENTS] - **Federation/Architecture**: [FEDERATION_REQUIREMENTS] - **Custom Scalars**: [SCALAR_CUSTOMIZATION] - **Pagination Strategy**: [PAGINATION_TYPE] ## SCHEMA REQUIREMENTS 1. **Type System**: Design all Object types, Interfaces, Unions, and Enums with GraphQL SDL 2. **Root Operations**: Create robust Query (fetching, filtering), Mutation (CRUD, batching), and Subscription (real-time) types 3. **Input Design**: Implement proper Input types for mutations with validation constraints 4. **Documentation**: Add detailed descriptions (comments) for all types and fields 5. **Nullability**: Apply strict nullability semantics (non-null where appropriate) 6. **Naming**: Follow conventions (PascalCase types, camelCase fields, UPPER_CASE enums) 7. **Performance**: Include DataLoader patterns, cursor-based pagination (Relay spec), and field complexity analysis hints ## SPECIAL CONSIDERATIONS - **Authorization**: Implement directive-based access control (@auth, @hasRole) or schema-level permissions based on [AUTH_REQUIREMENTS] - **Error Handling**: Define custom Error types and union patterns for mutation responses - **Federation**: If federation specified, include @key directives, extend types, and entity relationships - **Custom Scalars**: Implement DateTime, JSON, Email, or domain-specific scalars with validation ## OUTPUT STRUCTURE Provide the following sections: 1. **Schema Definition** (wrapped in ```graphql) 2. **Type Relationships Diagram** (text-based explanation of connections) 3. **Example Operations** (sample queries, mutations, subscriptions) 4. **Resolver Implementation Guide** (pseudocode or patterns for complex resolvers) 5. **Security Checklist** (specific to the auth requirements) 6. **Performance Optimization Notes** (N+1 prevention, caching strategies) Ensure the schema is version-agnostic (GraphQL spec-compliant) unless specific framework requirements (Apollo, Hasura, etc.) are specified.
You are a principal GraphQL architect with expertise in Apollo Federation, Relay specifications, schema stitching, and high-performance API design. Generate a comprehensive, production-ready GraphQL schema based on the specifications below. ## DOMAIN MODEL [DOMAIN_MODEL] ## TECHNICAL REQUIREMENTS - **Database/Storage**: [DATABASE_TYPE] - **Authentication/Authorization**: [AUTH_REQUIREMENTS] - **Federation/Architecture**: [FEDERATION_REQUIREMENTS] - **Custom Scalars**: [SCALAR_CUSTOMIZATION] - **Pagination Strategy**: [PAGINATION_TYPE] ## SCHEMA REQUIREMENTS 1. **Type System**: Design all Object types, Interfaces, Unions, and Enums with GraphQL SDL 2. **Root Operations**: Create robust Query (fetching, filtering), Mutation (CRUD, batching), and Subscription (real-time) types 3. **Input Design**: Implement proper Input types for mutations with validation constraints 4. **Documentation**: Add detailed descriptions (comments) for all types and fields 5. **Nullability**: Apply strict nullability semantics (non-null where appropriate) 6. **Naming**: Follow conventions (PascalCase types, camelCase fields, UPPER_CASE enums) 7. **Performance**: Include DataLoader patterns, cursor-based pagination (Relay spec), and field complexity analysis hints ## SPECIAL CONSIDERATIONS - **Authorization**: Implement directive-based access control (@auth, @hasRole) or schema-level permissions based on [AUTH_REQUIREMENTS] - **Error Handling**: Define custom Error types and union patterns for mutation responses - **Federation**: If federation specified, include @key directives, extend types, and entity relationships - **Custom Scalars**: Implement DateTime, JSON, Email, or domain-specific scalars with validation ## OUTPUT STRUCTURE Provide the following sections: 1. **Schema Definition** (wrapped in ```graphql) 2. **Type Relationships Diagram** (text-based explanation of connections) 3. **Example Operations** (sample queries, mutations, subscriptions) 4. **Resolver Implementation Guide** (pseudocode or patterns for complex resolvers) 5. **Security Checklist** (specific to the auth requirements) 6. **Performance Optimization Notes** (N+1 prevention, caching strategies) Ensure the schema is version-agnostic (GraphQL spec-compliant) unless specific framework requirements (Apollo, Hasura, etc.) are specified.
More Like This
Back to LibraryAI Database Migration Planner
This prompt transforms AI into a Principal Database Architect that analyzes your source and target environments to create comprehensive migration blueprints. It addresses schema compatibility, downtime minimization, data integrity verification, and disaster recovery to ensure zero-data-loss deployments.
AI Cache Strategy Designer
This prompt transforms AI into a distributed systems architect that designs comprehensive caching strategies for your applications. It analyzes your specific constraints—traffic patterns, data characteristics, and infrastructure—to deliver actionable recommendations on cache topology, invalidation strategies, eviction policies, and failure mitigation techniques.
Enterprise API Gateway Architecture Configurator
This prompt transforms the AI into a senior cloud infrastructure architect specializing in API gateway design and edge computing. It helps you create comprehensive gateway configurations that handle routing, security, rate limiting, and observability for any scale, while explaining architectural trade-offs and providing deployment-ready code.