Skip to content

Commit

Permalink
refactor: ♻️ TasksResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Dec 17, 2024
1 parent 372d010 commit 1a24931
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Injectable } from '@nestjs/common';
import { Query, Resolver } from '@nestjs/graphql';
import { TasksService } from '@tasks/application';
import { GetAllTasksUseCase } from '@tasks/application';

import { TaskDto } from '../dto/task.dto';
import { Injectable } from '@nestjs/common';

@Injectable()
@Resolver(() => [TaskDto])
export class TasksResolver {
constructor(private tasksService: TasksService) {}
constructor(private getAllTasksUseCase: GetAllTasksUseCase) {}

@Query(() => [TaskDto])
async getTasks(): Promise<TaskDto[]> {
return this.tasksService.findAll();
return this.getAllTasksUseCase.execute();
}
}

0 comments on commit 1a24931

Please sign in to comment.