@pothos/plugin-dataloader
Version:
A Pothos plugin for attaching dataloader to object types
15 lines (14 loc) • 1.14 kB
TypeScript
import { ImplementableObjectRef, ObjectRef, type SchemaTypes } from '@pothos/core';
import type DataLoader from 'dataloader';
import type { DataLoaderOptions } from '../types.js';
export declare class LoadableObjectRef<Types extends SchemaTypes, RefShape, Shape, Key, CacheKey> extends ObjectRef<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 ImplementableLoadableObjectRef<Types extends SchemaTypes, RefShape, Shape, Key extends bigint | number | string, CacheKey> extends ImplementableObjectRef<Types, RefShape, Shape> {
getDataloader: import("@pothos/core").ContextCache<DataLoader<Key, Shape, CacheKey>, object, [
]>;
protected cacheResolved: false | ((value: Shape) => Key) | undefined;
constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string, { loaderOptions, load, toKey, sort, cacheResolved, }: DataLoaderOptions<Types, Shape | Error, Key, CacheKey, Shape>);
}
//# sourceMappingURL=object.d.ts.map