@envelop/parser-cache
Version:
15 lines (14 loc) • 474 B
TypeScript
import type { DocumentNode } from 'graphql';
import type { Plugin } from '@envelop/core';
interface Cache<T> {
get(key: string): T | undefined;
set(key: string, value: T): void;
}
export type DocumentCache = Cache<DocumentNode>;
export type ErrorCache = Cache<Error>;
export type ParserCacheOptions = {
documentCache?: DocumentCache;
errorCache?: ErrorCache;
};
export declare const useParserCache: (pluginOptions?: ParserCacheOptions) => Plugin;
export {};