graphql / graphql/dataloader

[QUESTION] Is possible chain two dataloaders?

Open
#229 1 comment 3 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
13.4k
Forks
518
Avg merge
2d 4h
Merged PRs (30d)
2

Description

Hi, is it possible chain two dataloaders? I have one resolver where I need using two dataloaders, is it possible? I can't use SQL join because it's slow.

```
async (row, _, { dataSources }) => {
const partialData = await dataloader1(dataSources).load(row.id);
if (partialData === null) {
return null;
}
return await dataloader2(dataSources).load(partialData.id);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.