import * as TypeGraphQL from "type-graphql" ; import graphqlFields from "graphql-fields" ; import { GraphQLResolveInfo } from "graphql" ; import { DeleteManyProblemArgs } from "./args/DeleteManyProblemArgs" ; import { Problem } from "../../../models/Problem" ; import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput" ; import { transformFields , getPrismaFromContext , transformCountFieldIntoSelectRelationsCount } from "../../../helpers" ; @ TypeGraphQL . Resolver ( _of => Problem ) export class DeleteManyProblemResolver { @ TypeGraphQL . Mutation ( _returns => AffectedRowsOutput , { nullable : false } ) async deleteManyProblem ( @ TypeGraphQL . Ctx ( ) ctx , @ TypeGraphQL . Info ( ) info , @ TypeGraphQL . Args ( ) args ) { const { _count } = transformFields ( graphqlFields ( info as any ) ) ; return getPrismaFromContext ( ctx ) . problem . deleteMany ( { ... args , ... ( _count && transformCountFieldIntoSelectRelationsCount ( _count ) ) , } ) ; } }