Tech
Count the Resolver, Not the Query, to Catch a GraphQL N+1
You will catch a GraphQL N+1 much earlier by counting how many times your batch loader is called against a temporary mock server than by measuring response time, because latency tests hide the problem behind small local datasets, in-memory caches, and a developer machine that is simply too fast to notice. The classic mistake is to add a deeply nested field, run one query that returns three posts, see a snappy response, and ship. That query may call the author loader three times instead of once, ...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to