File

libs/tasks/interface-adapters/src/lib/resolver/tasks.resolver.ts

Index

Methods

Constructor

constructor(getAllTasksUseCase: GetAllTasksUseCase)
Parameters :
Name Type Optional
getAllTasksUseCase GetAllTasksUseCase No

Methods

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();
  }
}

results matching ""

    No results matching ""