import * as TypeGraphQL from "type-graphql"; import type { GraphQLResolveInfo } from "graphql"; import { DeleteManyCompanyArgs } from "./args/DeleteManyCompanyArgs"; import { Company } from "../../../models/Company"; import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput"; import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers"; @TypeGraphQL.Resolver(_of => Company) export class DeleteManyCompanyResolver { @TypeGraphQL.Mutation(_returns => AffectedRowsOutput, { nullable: false }) async deleteManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyCompanyArgs): Promise { const { _count } = transformInfoIntoPrismaArgs(info); return getPrismaFromContext(ctx).company.deleteMany({ ...args, ...(_count && transformCountFieldIntoSelectRelationsCount(_count)), }); } }