import * as TypeGraphQL from "type-graphql" ; import graphqlFields from "graphql-fields" ; import { GraphQLResolveInfo } from "graphql" ; import { FindManyCategoryArgs } from "./args/FindManyCategoryArgs" ; import { Category } from "../../../models/Category" ; import { transformFields , getPrismaFromContext , transformCountFieldIntoSelectRelationsCount } from "../../../helpers" ; @ TypeGraphQL . Resolver ( _of => Category ) export class FindManyCategoryResolver { @ TypeGraphQL . Query ( _returns => [ Category ] , { nullable : false } ) async categories ( @ TypeGraphQL . Ctx ( ) ctx , @ TypeGraphQL . Info ( ) info , @ TypeGraphQL . Args ( ) args ) { const { _count } = transformFields ( graphqlFields ( info as any ) ) ; return getPrismaFromContext ( ctx ) . category . findMany ( { ... args , ... ( _count && transformCountFieldIntoSelectRelationsCount ( _count ) ) , } ) ; } }