# DataLoader type · @imqueue/graphql-dependency

Source: https://imqueue.org/api/graphql-dependency/latest/graphql-dependency.dataloader/
Published: 2026-07-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/graphql-dependency 3.1.0 — generated reference, not hand-written

A bulk fetch for one entity type, registered with `defineLoader()` and called whenever that type is needed as another type's dependency.

**Signature:**

```typescript
export type DataLoader<T> = (context: any, filter: any, fields?: any) => Promise<T[]>;
```

## Remarks

Every object returned must carry an `id`: results are keyed by it and attached to their parents by it, and one without an `id` is silently unreachable.

`filter` arrives with a \*set\* of values under each key rather than one value, because a whole level of parent objects is fetched in a single call — so the implementation has to treat every key as a list. Its shape is decided by the `require()` calls that point at this type.

