Performance: Resolvers
MEDIUM IMPACT
Resolvers impact server response time and client perceived latency by controlling how data is fetched and processed before sending to the client.
async user() { const user = await this.userService.findUserWithPosts(); return user; }
async user() { const user = await this.userService.findUser(); user.posts = await Promise.all(user.postIds.map(id => this.postService.findPostById(id))); return user; }
| Pattern | Server Calls | Latency Impact | Network Payload | Verdict |
|---|---|---|---|---|
| Multiple nested calls per resolver | Many sequential calls | High latency | Larger payload due to delays | [X] Bad |
| Single optimized query per resolver | One call with joins | Low latency | Smaller, timely payload | [OK] Good |