import * as TypeGraphQL from "type-graphql" ; import { MainUser } from "../../../models/MainUser" ; import { Post } from "../../../models/Post" ; import { MainUserPostsArgs } from "./args/MainUserPostsArgs" ; import { transformFields , getPrismaFromContext , transformCountFieldIntoSelectRelationsCount } from "../../../helpers" ; @ TypeGraphQL . Resolver ( _of => MainUser ) export class MainUserRelationsResolver { @ TypeGraphQL . FieldResolver ( _type => [ Post ] , { nullable : false } ) async clientPosts ( @ TypeGraphQL . Root ( ) mainUser , @ TypeGraphQL . Ctx ( ) ctx , @ TypeGraphQL . Args ( ) args ) { return getPrismaFromContext ( ctx ) . user . findUnique ( { where : { id : mainUser . id , } , } ) . posts ( args ) ; } }