import { Resolver , Query , Mutation , Args } from '@nestjs/graphql' ; import { CatsService } from './cats.service' ; import { CatType } from './dto/create-cat.dto' ; import { CatInput } from './inputs/cat.input' ; @ Resolver ( ) export class CatsResolver { constructor ( private readonly catsService ) { } @ Query ( ( ) => String ) async hello ( ) { return 'hello' ; } @ Query ( ( ) => [ CatType ] ) async cats ( ) { return this . catsService . findAll ( ) ; } @ Mutation ( ( ) => CatType ) async createCat ( @ Args ( 'input' ) input ) { return this . catsService . create ( input ) ; } }