import * as TypeGraphQL from "type-graphql" ; import graphqlFields from "graphql-fields" ; import { GraphQLResolveInfo } from "graphql" ; import { UpdateMovieArgs } from "./args/UpdateMovieArgs" ; import { Movie } from "../../../models/Movie" ; import { transformFields , getPrismaFromContext , transformCountFieldIntoSelectRelationsCount } from "../../../helpers" ; @ TypeGraphQL . Resolver ( _of => Movie ) export class UpdateMovieResolver { @ TypeGraphQL . Mutation ( _returns => Movie , { nullable : true } ) async updateMovie ( @ TypeGraphQL . Ctx ( ) ctx , @ TypeGraphQL . Info ( ) info , @ TypeGraphQL . Args ( ) args ) { const { _count } = transformFields ( graphqlFields ( info as any ) ) ; return getPrismaFromContext ( ctx ) . movie . update ( { ... args , ... ( _count && transformCountFieldIntoSelectRelationsCount ( _count ) ) , } ) ; } }