graphql-modules
Version:
Create reusable, maintainable, testable and extendable GraphQL modules
7 lines (6 loc) • 378 B
TypeScript
export interface AsyncContext {
getApplicationContext(): GraphQLModules.AppContext;
getModuleContext(moduleId: string): GraphQLModules.ModuleContext;
}
export declare function getAsyncContext(): AsyncContext | undefined;
export declare function runWithAsyncContext<R, TArgs extends any[]>(asyncContext: AsyncContext, callback: (...args: TArgs) => R, ...args: TArgs): R;