# GraphQL Analysis Examples

## Example 1: N+1 Problem

**Input:**
```
Explain the N+1 problem in GraphQL and how to solve it.
```

**Expected Output:**
N+1 query explanation, DataLoader pattern, batching and caching, implementation example, performance impact.

## Example 2: Pagination Design

**Input:**
```
Design cursor-based pagination for a GraphQL API following Relay Connection spec.
```

**Expected Output:**
Connection type structure, edges and nodes, PageInfo, forward/backward pagination, cursor encoding.

## Example 3: GraphQL vs REST

**Input:**
```
When should I use GraphQL instead of REST?
```

**Expected Output:**
Comparison of use cases, GraphQL strengths (flexible queries, single endpoint), REST strengths (simplicity, caching), recommendation matrix.

## Common Use Cases

- API design decisions
- Schema design review
- Performance optimization
- N+1 problem solving
- Authentication patterns
- Real-time features
