mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
feat: added dataloader for caching
This commit is contained in:
parent
43b7d50724
commit
fe268bf141
@ -2,5 +2,7 @@ import DataLoader from 'dataloader'
|
|||||||
import * as Query from './Query'
|
import * as Query from './Query'
|
||||||
|
|
||||||
const loaders = {
|
const loaders = {
|
||||||
user: new DataLoader(async(ids:string) => await Query.getUser(ids))
|
bor: new DataLoader(async (ids:string[]) => await Promise.all(ids.map((el:string)=> Query.getBot(el)))),
|
||||||
|
user: new DataLoader(async (ids:string[]) => await Promise.all(ids.map((el:string)=> Query.getUser(el)))),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user