Multiple ChoiceIntermediate 45s
GraphQL resolver N+1
A GraphQL query returns 100 posts and each post's author field triggers a separate DB lookup. What is this and the standard fix?
Options
- 1The N+1 problem; batch and cache with a DataLoader-style per-request loader
- 2An injection flaw in the resolver; sanitize inputs so it stops repeating one lookup
- 3A memory leak in the loader; restart the server so it stops holding references to parent rows
- 4A serialization bug; switch to protobuf so repeated per-parent lookups collapse
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.