doug-martin / nestjs-query

Easy CRUD for GraphQL.

Home Page:https://doug-martin.github.io/nestjs-query

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How i read deleted rows in a querie ( i using soft-delete) ?

raphamartinez opened this issue · comments

Is your feature request related to a problem? Please describe.
I want to query only the data deleted using soft delete so the user can choose which data they want to recover.

a temporary solution in the resolver but it works.

example for userDTO

  @Query(() => [UserDTO])
  async usersDeleted( ): Promise<UserDTO[]> {
    const repo = this.service.repo;
    const data = await repo.createQueryBuilder('user').withDeleted().getMany();

    return Promise.resolve(data);
  }