3 ms·
The most common practice is to turn N+1 into 1+1 using dataloaders (https://github.com/graphql/dataloader https://github.com/graphql/dataloader for JS, there ar
by ptramo 3y ago
The most common practice is to turn N+1 into 1+1 using dataloaders (https://github.com/graphql/dataloader https://github.com/graphql/dataloader for JS, there are equivalents for most implementations). The N resolvers invoke a single batched loader which receives a list of keys and returns a list of values.