import * as TypeGraphQL from "type-graphql" ; import { Director } from "../../../models/Director" ; import { Movie } from "../../../models/Movie" ; import { DirectorMoviesArgs } from "./args/DirectorMoviesArgs" ; import { transformFields , getPrismaFromContext , transformCountFieldIntoSelectRelationsCount } from "../../../helpers" ; @ TypeGraphQL . Resolver ( _of => Director ) export class DirectorRelationsResolver { @ TypeGraphQL . FieldResolver ( _type => [ Movie ] , { nullable : false } ) async movies ( @ TypeGraphQL . Root ( ) director , @ TypeGraphQL . Ctx ( ) ctx , @ TypeGraphQL . Args ( ) args ) { return getPrismaFromContext ( ctx ) . director . findUnique ( { where : { firstName_lastName : { firstName : director . firstName , lastName : director . lastName , } , } , } ) . movies ( args ) ; } }