mirror of
https://github.com/wassname/talk.git
synced 2026-08-10 12:41:02 +08:00
initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import DataLoader from 'dataloader';
|
||||
import {
|
||||
Asset,
|
||||
retrieveMany as retrieveManyAssets,
|
||||
} from 'talk-server/models/asset';
|
||||
import Context from 'talk-server/graph/context';
|
||||
|
||||
const loadAssets = async (ctx: Context, ids: string[]): Promise<Array<Asset>> =>
|
||||
retrieveManyAssets(ctx.db, ids);
|
||||
|
||||
export default (ctx: Context) => ({
|
||||
asset: new DataLoader<string, Asset>(ids => loadAssets(ctx, ids)),
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import Asset from './asset';
|
||||
import Context from 'talk-server/graph/context';
|
||||
|
||||
export default (ctx: Context) => ({ Asset: Asset(ctx) });
|
||||
Reference in New Issue
Block a user