Practice vocabulary for GraphQL performance topics including N+1 problem, DataLoader, query cost analysis, depth limiting, and persisted queries.
0 / 5 completed
1 / 5
The N+1 problem in GraphQL occurs when _____.
The N+1 problem: fetching a list of N objects (1 query) then resolving a related field for each item triggers N more queries — totaling N+1 database calls instead of 1 or 2.
2 / 5
DataLoader solves the N+1 problem by _____.
DataLoader batches all individual load() calls within a single event loop tick into one database call, then distributes the results back to each resolver — eliminating N+1.
3 / 5
Query cost analysis in GraphQL assigns a 'cost' to each field so that _____.
Query cost analysis statically estimates the server load a query will impose before running it, allowing the server to reject queries that exceed a cost budget.
4 / 5
'Depth limiting prevents malicious deep queries' refers to the practice of _____.
Depth limiting caps the nesting depth of a GraphQL query — without it, an attacker could craft a deeply nested query that causes exponential resolver calls, overwhelming the server.
5 / 5
Persisted queries improve GraphQL performance by _____.
Persisted queries store named query strings on the server; clients send only a hash identifier. This reduces payload size, enables CDN caching, and can whitelist only known queries for security.