UNPKG

graphql-modules

Version:

Create reusable, maintainable, testable and extendable GraphQL modules

15 lines (14 loc) • 496 B
export function operationControllerCreator(options) { const { contextBuilder } = options; return (input) => { const operation = contextBuilder(input.context); const ɵdestroy = input.autoDestroy ? operation.ɵdestroy : () => { }; return { context: operation.context, injector: operation.ɵinjector, destroy: operation.ɵdestroy, ɵdestroy, ɵrunWithContext: operation.runWithContext, }; }; }