import { Injectable } from '@nestjs/common' ; import { CommandBus } from '@nestjs/cqrs' ; import { SayHelloCommand } from './say-hello.command' ; @ Injectable ( ) export class AppService { constructor ( private commandBus ) { } async getHello ( queryArgs ) { return this . commandBus . execute ( new SayHelloCommand ( queryArgs . name ) ) ; } }