UNPKG

graphql-modules

Version:

Create reusable, maintainable, testable and extendable GraphQL modules

21 lines (20 loc) 970 B
export interface ExecutionContextConfig { executionAsyncId: () => number; createHook(config: { init(asyncId: number, _: string, triggerAsyncId: number): void; destroy(asyncId: number): void; }): void; } export interface ExecutionContextPicker { getModuleContext(moduleId: string): GraphQLModules.ModuleContext; getApplicationContext(): GraphQLModules.AppContext; } export declare const executionContext: { create(picker: ExecutionContextPicker): () => void; getModuleContext: ExecutionContextPicker['getModuleContext']; getApplicationContext: ExecutionContextPicker['getApplicationContext']; }; export declare function enableExecutionContext(config: ExecutionContextConfig): void; export declare function assertExecutionContext(): void | never; export declare function getExecutionContextStore(): Map<number, ExecutionContextPicker>; export declare function getExecutionContextDependencyStore(): Map<number, Set<number>>;