Fifty One Queries

A GraphQL query asks for 50 posts and each post's author. Query logs show one SELECT for the posts followed by 50 single row SELECTs against the users table. What is the standard fix?

A

Cache the whole GraphQL response at the CDN keyed on the query text, so repeated queries skip the resolvers entirely

B

Batch the author lookups through a per-request loader that collects the ids and issues one query with an IN clause

C

Add an index on the users table primary key so each of the 50 single row lookups resolves with one seek instead of a scan

D

Lower the maximum query depth so the schema rejects the nested author selection before any resolver runs