libs/tasks/interface-adapters/src/lib/resolver/tasks.resolver.ts
Methods |
|
constructor(getAllTasksUseCase: GetAllTasksUseCase)
|
||||||
Parameters :
|
Async getTasks |
getTasks()
|
Decorators :
@Query(undefined)
|
Returns :
Promise<TaskDto[]>
|
import { Injectable } from '@nestjs/common';
import { Query, Resolver } from '@nestjs/graphql';
import { GetAllTasksUseCase } from '@tasks/application';
import { TaskDto } from '../dto/task.dto';
@Injectable()
@Resolver(() => [TaskDto])
export class TasksResolver {
constructor(private getAllTasksUseCase: GetAllTasksUseCase) {}
@Query(() => [TaskDto])
async getTasks(): Promise<TaskDto[]> {
return this.getAllTasksUseCase.execute();
}
}