@pothos/plugin-dataloader
Version:
A Pothos plugin for attaching dataloader to object types
16 lines (15 loc) • 1.41 kB
TypeScript
import { ImplementableInterfaceRef, type InterfaceParam, InterfaceRef, type InterfaceTypeOptions, type SchemaTypes } from '@pothos/core';
import type DataLoader from 'dataloader';
import type { DataLoaderOptions } from '../types.js';
export declare class LoadableInterfaceRef<Types extends SchemaTypes, RefShape, Shape, Key, CacheKey> extends InterfaceRef<Types, RefShape, Shape> {
getDataloader: (context: Types["Context"]) => DataLoader<Key, Shape, CacheKey>;
constructor(name: string, getDataloader: (context: Types["Context"]) => DataLoader<Key, Shape, CacheKey>);
}
export declare class ImplementableLoadableInterfaceRef<Types extends SchemaTypes, RefShape, Shape, Key extends bigint | number | string, CacheKey> extends ImplementableInterfaceRef<Types, RefShape, Shape> {
cacheResolved: false | ((value: Shape) => Key) | undefined;
getDataloader: import("@pothos/core").ContextCache<DataLoader<Key, Shape, CacheKey>, object, [
]>;
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string, { loaderOptions, load, toKey, sort, cacheResolved, }: DataLoaderOptions<Types, Shape | Error, Key, CacheKey, Shape>);
implement<const Interfaces extends InterfaceParam<Types>[]>(options: InterfaceTypeOptions<Types, ImplementableInterfaceRef<Types, RefShape, Shape>, Shape, Interfaces>): InterfaceRef<Types, RefShape, Shape>;
}
//# sourceMappingURL=interface.d.ts.map