UNPKG

@graphql-mesh/runtime

Version:
24 lines (23 loc) 1.08 kB
import type { DocumentNode, GraphQLSchema } from 'graphql'; import type { Plugin } from '@envelop/core'; import { envelop } from '@envelop/core'; import type { KeyValueCache, Logger, MeshFetch, MeshPlugin, MeshPubSub, RawSourceOutput } from '@graphql-mesh/types'; import type { ExecuteMeshFn, GetMeshOptions, MeshExecutor, SubscribeMeshFn } from './types.cjs'; type SdkRequester = (document: DocumentNode, variables?: any, operationContext?: any) => any; export interface MeshInstance extends Disposable { execute: ExecuteMeshFn; subscribe: SubscribeMeshFn; schema: GraphQLSchema; createExecutor(globalContext: any): MeshExecutor; rawSources: RawSourceOutput[]; destroy(): void; pubsub: MeshPubSub; cache: KeyValueCache; logger: Logger; plugins: Plugin[]; getEnveloped: ReturnType<typeof envelop>; sdkRequesterFactory(globalContext: any): SdkRequester; } export declare function wrapFetchWithPlugins(plugins: MeshPlugin<any>[]): MeshFetch; export declare function getMesh(options: GetMeshOptions): Promise<MeshInstance>; export {};