import { ModuleRef } from '@nestjs/core'; import type { ContainerType, ResolverData } from 'type-graphql'; import { getContext } from '../ContextProvider'; export class NestContainerType implements ContainerType { private moduleRef?: ModuleRef; get(someClass: any, _resolverData: ResolverData): any | Promise { let ref = (this.moduleRef ||= getContext(ModuleRef)); return ref.get(someClass, { strict: false }); } }