Tick Batching ≠ Redis
DataLoader batches calls made within one JS event-loop tick (queueMicrotask) and deduplicates keys within one HTTP request—it is not a cross-request cache.
See how a single nested list field explodes into 1 + N database roundtrips — and how DataLoader collapses them into one SQL IN(...) batch inside a single event-loop tick.
DataLoader batches calls made within one JS event-loop tick (queueMicrotask) and deduplicates keys within one HTTP request—it is not a cross-request cache.
SQL WHERE id IN (...) returns rows in arbitrary order. Always return keys.map(k => byId.get(k) ?? null) so indices and lengths match 1:1.
Construct new DataLoader(...) inside your GraphQL context() factory on every request to prevent cross-user data leaks and unbounded memory growth.