UNPKG

@giraphql/plugin-dataloader

Version:

A GiraphQL plugin for attaching dataloader to object types

6 lines 833 B
import DataLoader, { Options } from 'dataloader'; import { MaybePromise, SchemaTypes } from '@giraphql/core'; export declare function rejectErrors<T>(val: MaybePromise<(Error | T)[]>): MaybePromise<(Promise<T> | T)[]>; export declare function loadAndSort<K, V, C>(load: (keys: K[], context: C) => Promise<(Error | V)[]>, toKey: false | ((val: V) => K) | undefined): ((keys: K[], context: C) => Promise<(Error | V)[]>) | ((keys: K[], context: C) => Promise<(V | null)[]>); export declare function dataloaderGetter<K, V, C>(loaderOptions: Options<K, V, C> | undefined, load: (keys: K[], context: SchemaTypes['Context']) => Promise<(Error | V)[]>, toKey: ((val: V) => K) | undefined, sort: boolean | ((val: V) => K) | undefined): import("@giraphql/core").ContextCache<DataLoader<K, V, C>, object, []>; //# sourceMappingURL=util.d.ts.map