UNPKG

@entria/graphql-mongoose-loader

Version:
11 lines (10 loc) 436 B
/** * Helper to batch queries on mongoose */ export declare const cacheKeyFn: (key: string) => string; declare type MongooseProjection = object | string; declare type Mongoose$Document = { find(criteria?: object, projection?: MongooseProjection, options?: object): any; }; export default function mongooseLoader(model: Mongoose$Document, keys: ReadonlyArray<string>, lean?: boolean, keyField?: string): Promise<any[]>; export {};