# graphql/dataloader

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/graphql-dataloader).**

13,380 stars · 514 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/graphql/dataloader
- awesome-repositories: https://awesome-repositories.com/repository/graphql-dataloader.md

## Topics

`batch` `dataloader` `graphql` `nodejs`

## Description

DataLoader is a utility that collects individual data loads into a single batch and caches results to minimize redundant backend requests. It operates on a batch-and-cache architecture, where multiple data lookups within a single execution frame are grouped together and dispatched as one request, with the results stored in memory for instant retrieval on subsequent calls.

The utility distinguishes itself through several key capabilities. It supports per-key error handling, allowing partial failures within a batch without rejecting the entire operation. A cache priming mechanism lets developers pre-populate the cache with known key-value pairs, while explicit cache invalidation methods enable clearing specific keys or the entire cache to force fresh data loads. The cache store is pluggable, allowing the default in-memory Map to be replaced with alternative implementations such as an LRU cache. A scheduler-based dispatch system provides control over when accumulated loads are sent as a batch, supporting manual triggering or delayed execution.

The broader capability surface includes batch data loading, caching data lookups, and custom cache strategies. The documentation covers configuration for customizing batch scheduling and swapping cache stores, as well as methods for loading multiple keys and clearing cached entries.

## Tags

### Development Tools & Productivity

- [Data Batching and Caching Utilities](https://awesome-repositories.com/f/development-tools-productivity/batching-utilities/data-batching-and-caching-utilities.md) — Collects multiple data loads into a single batch and caches results to reduce backend requests.
- [Cache Invalidation](https://awesome-repositories.com/f/development-tools-productivity/build-artifact-caching/cache-invalidation.md) — Provides methods to clear specific keys or the entire cache to force fresh data loads.
- [Load Dispatch Schedulers](https://awesome-repositories.com/f/development-tools-productivity/email-delivery-services/dispatch-scheduling/load-dispatch-schedulers.md) — Uses a custom scheduler to control when accumulated loads are dispatched as a batch.

### Data & Databases

- [Batched Data Loading](https://awesome-repositories.com/f/data-databases/data-pipeline-orchestration/data-engineering-pipelines/batched-data-loading.md) — Collects multiple individual data requests into a single batch to reduce backend round trips.
- [Custom Batch Triggers](https://awesome-repositories.com/f/data-databases/batch-processing-schedulers/custom-batch-triggers.md) — Controls when a batch of collected loads is dispatched, enabling manual triggering or delayed execution. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))
- [Cache Priming Mechanisms](https://awesome-repositories.com/f/data-databases/caching-mechanisms/cache-priming-mechanisms.md) — Provides a cache priming mechanism to pre-populate the cache with known key-value pairs.
- [Cache Priming](https://awesome-repositories.com/f/data-databases/data-caching/cross-request-data-caches/cache-priming.md) — Pre-populates the cache with known key-value pairs to avoid unnecessary backend requests for expected data.
- [Cache Clearing](https://awesome-repositories.com/f/data-databases/data-caching/persistent-binary-caches/cache-clearing.md) — Clear cached entries by removing a specific key or the entire cache to force fresh data loads. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))
- [Pluggable Cache Implementations](https://awesome-repositories.com/f/data-databases/in-memory-caches/pluggable-cache-implementations.md) — Replaces the default in-memory cache with alternative implementations like LRU to manage memory.
- [Pluggable Cache Stores](https://awesome-repositories.com/f/data-databases/in-memory-caches/pluggable-cache-stores.md) — Replaces the default in-memory Map with any cache implementation, such as an LRU cache. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))
- [Cache Priming Operations](https://awesome-repositories.com/f/data-databases/key-value-stores/cache-key-management/cache-value-readers/cache-priming-operations.md) — Primes the cache with known key-value pairs so future loads return immediately without a backend request. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))

### Software Engineering & Architecture

- [Request Batching](https://awesome-repositories.com/f/software-engineering-architecture/request-batching.md) — Collects individual data loads into batches and caches results to minimize redundant backend requests.
- [Resolved Value Caching](https://awesome-repositories.com/f/software-engineering-architecture/resolved-value-caching.md) — Cache loaded values in memory so repeated key lookups resolve instantly without a backend call. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))
- [Partial List Error Handling](https://awesome-repositories.com/f/software-engineering-architecture/error-handling-strategies/monadic-error-handling/partial-list-error-handling.md) — Resolves each key individually in a batch, allowing partial failures without rejecting the entire batch.

### System Administration & Monitoring

- [Key-Value Batching](https://awesome-repositories.com/f/system-administration-monitoring/resource-batch-operations/general-batch-operations/key-value-batching.md) — Accepts an array of keys and resolves each to its value or an error, handling partial failures. ([source](https://cdn.jsdelivr.net/gh/graphql/dataloader@main/README.md))

### DevOps & Infrastructure

- [Custom Batch Dispatch Schedulers](https://awesome-repositories.com/f/devops-infrastructure/task-queues/batch-dispatching/custom-batch-dispatch-schedulers.md) — Controls when batched loads are dispatched through custom schedulers for manual or delayed execution.

### Web Development

- [Pluggable Cache Backends](https://awesome-repositories.com/f/web-development/content-caching-accelerators/object-caches/pluggable-cache-backends.md) — Allows swapping the default in-memory Map cache with any external cache implementation.
