2cd081234f
* chore: wip refacto in modules * fix: rollback port * fix: jwt guard in wrong folder * chore: rename folder exception-filter in filters * fix: tests are running * fix: excessive stack depth comparing types * fix: auth issue * chore: move createUser in UserService * fix: test * fix: guards * fix: jwt guard don't handle falsy user
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import * as TypeGraphQL from '@nestjs/graphql';
|
|
import { PipelineProgress } from 'src/core/@generated/pipeline-progress/pipeline-progress.model';
|
|
import { PipelineStage } from 'src/core/@generated/pipeline-stage/pipeline-stage.model';
|
|
import { Pipeline } from 'src/core/@generated/pipeline/pipeline.model';
|
|
import { PipelineStageService } from '../services/pipeline-stage.service';
|
|
import { PipelineService } from '../services/pipeline.service';
|
|
|
|
@TypeGraphQL.Resolver(() => PipelineProgress)
|
|
export class PipelineProgressRelationsResolver {
|
|
constructor(
|
|
private readonly pipelineStageService: PipelineStageService,
|
|
private readonly pipelineService: PipelineService,
|
|
) {}
|
|
|
|
@TypeGraphQL.ResolveField(() => PipelineStage, {
|
|
nullable: false,
|
|
})
|
|
async pipelineStage(
|
|
@TypeGraphQL.Root() pipelineStage: PipelineProgress,
|
|
): Promise<PipelineStage> {
|
|
return this.pipelineStageService.findUniqueOrThrow({
|
|
where: {
|
|
id: pipelineStage.pipelineStageId,
|
|
},
|
|
});
|
|
}
|
|
|
|
@TypeGraphQL.ResolveField(() => Pipeline, {
|
|
nullable: false,
|
|
})
|
|
async pipeline(
|
|
@TypeGraphQL.Root() pipelineStage: PipelineProgress,
|
|
): Promise<Pipeline> {
|
|
return this.pipelineService.findUniqueOrThrow({
|
|
where: {
|
|
id: pipelineStage.pipelineId,
|
|
},
|
|
});
|
|
}
|
|
}
|