Programování
Expert
Claude
GraphQL schema s resolvers
Návrh GraphQL schema s efektivními resolvers a dataloaders.
Prompt text
Délka: Střední
Vytvoř GraphQL schema pro [USE CASE]. Requirements:
**Types:**
[ENTITIES - např. User, Post, Comment]
**Queries:**
[READ OPERATIONS - např. getUser, getPosts]
**Mutations:**
[WRITE OPERATIONS - např. createPost, updateUser]
**Relationships:**
[RELATIONS - např. User has many Posts]
**Design:**
1. Schema definition (SDL)
2. Resolvers implementation
3. DataLoader pro N+1 problem
4. Authentication (context)
5. Input types & validation
6. Pagination (cursor-based)
7. Error handling
**Performance:**
- Query complexity limit
- Depth limit
- Caching strategy
**Security:**
- Auth directives
- Rate limiting
- Query cost analysis
Framework: [APOLLO/GRAPHQL-YOGA]. Language: [TS/JS].
**Types:**
[ENTITIES - např. User, Post, Comment]
**Queries:**
[READ OPERATIONS - např. getUser, getPosts]
**Mutations:**
[WRITE OPERATIONS - např. createPost, updateUser]
**Relationships:**
[RELATIONS - např. User has many Posts]
**Design:**
1. Schema definition (SDL)
2. Resolvers implementation
3. DataLoader pro N+1 problem
4. Authentication (context)
5. Input types & validation
6. Pagination (cursor-based)
7. Error handling
**Performance:**
- Query complexity limit
- Depth limit
- Caching strategy
**Security:**
- Auth directives
- Rate limiting
- Query cost analysis
Framework: [APOLLO/GRAPHQL-YOGA]. Language: [TS/JS].
Příklad použití
Vstup:
Vytvoř GraphQL schema pro blog platform. Types: User, Post, Comment. Queries: posts, user. Mutations: createPost, addComment. Relations: User 1:N Posts 1:N Comments. Framework: Apollo Server, TypeScript.
Výstup:
Complete GraphQL setup: Schema (User, Post, Comment types with relationships, getPost/getPosts queries with filters + pagination, createPost/updatePost/deletePost mutations with auth, Comment CRUD), Resolvers (field resolvers pro relationships, DataLoader eliminating N+1 on post.author, context with user auth), Input types (CreatePostInput with validation), cursor pagination on posts, error handling with custom errors (NotFoundError, AuthError), auth directives (@authenticated, @authorized), query complexity analysis (max 100), caching with Redis.
Kde použít tento prompt?
Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.
Podobné prompty
Advanced AI Features - Deep Dive do Pokročilých Funkcí
Komplexní průvodce pokročilými funkcemi AI nástrojů - od extended context a multimodality po tool use, streaming, a fine-tuning. Naučte se využívat plný potenciál moderních AI systémů.
Programování
Zobrazit
Algoritmus optimalizace
Optimalizace algoritmu z O(n²) na O(n log n) nebo lepší.
Programování
Zobrazit
API design s REST best practices
Návrh RESTful API s dokumentací a error handling.
Programování
Zobrazit
CI/CD pipeline setup
Konfigurace GitHub Actions / GitLab CI pipeline s testing a deployment.
Programování
Zobrazit
Objevte další AI prompty
Prozkoumejte naši sbírku Programování promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.