import { Controller , Mutation , Query } from "../../../../src" ; import { Category } from "../entity/Category" ; import { CategorySaveArgs } from "../args/CategorySaveArgs" ; import { CategoryRepository } from "../repository/CategoryRepository" ; @ Controller ( ) export class CategoryController { constructor ( private categoryRepository ) { } @ Query ( ) categories ( ) { return this . categoryRepository . find ( ) ; } @ Query ( ) category ( { id } ) { return this . categoryRepository . findById ( id ) ; } @ Mutation ( ) categorySave ( args ) { return this . categoryRepository . save ( args ) ; } }