All posts
AWS Amplify

One Screen, 241 DynamoDB Requests: How Nested GraphQL Queries Fan Out on AppSync

By

November 4, 2026

6 min read

A feed of 20 posts, each with its author and 10 comments with their authors, is one GraphQL query and 241 DynamoDB requests when each relationship resolver fetches per parent. The arithmetic by page size and nesting depth, what it costs per million screen views, and four ways to cut it, from batching to a single Postgres join.

Amplify Exit
AWS AppSync
GraphQL
DynamoDB
Performance

GraphQL resolves each field with its own resolver. For a relationship on a list, that resolver runs once per item unless it batches. With DynamoDB behind it there are no joins, so each run is its own request. One query from the browser becomes hundreds of database requests on the server.

Field

Resolver runs

DynamoDB requests

listPosts (20 items)

1

1 Query

post.author

20, one per post

20 GetItem

post.comments (10 each)

20, one per post

20 Query

comment.author

200, one per comment

200 GetItem

Total

241

241 requests, in three sequential rounds

Per-parent resolvers, no batching or caching.

10 posts12113120 posts24124150 posts601571100 posts1,2011121

Per-parent resolvers

Authors batched (BatchGetItem, 100 keys)

Postgres, one query with joins

DynamoDB requests for one feed screen, by number of posts shown (10 comments per post). Our arithmetic. Log scale.

The data
Per-parent resolversAuthors batched (BatchGetItem, 100 keys)Postgres, one query with joins
10 posts121131
20 posts241241
50 posts601571
100 posts1,2011121

What it costs

AppSync bills $4.00 per million queries and mutations. DynamoDB bills the requests behind them: with small items, each of the 241 requests reads half a request unit at most, about 120 units per screen, or $15 per million screen views at $0.125 per million reads. Together, about $19 per million views of one screen. That is rarely the bill that hurts. The latency of three sequential rounds of requests, and throttling when the comment-author fan-out hits one popular user's partition, are.

Four ways to cut it

  1. Ask for less: a selection set without comment authors removes 200 of the 241 requests. The cheapest fix is often in the client.

  2. Denormalize what every screen shows: store the author's name and avatar on the comment, and update it when a profile changes.

  3. Batch: a Lambda resolver with batching collects the 200 author lookups into two BatchGetItem calls.

  4. Move relational data to Postgres: one query with two joins returns the whole screen, and the GraphQL or REST layer above it stays.

Slow screens on AppSync or Amplify?

We'll read your schema and traces with you and tell you which of the four fixes pays off first. Free, 30 minutes.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of November 4, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.