Adrinalin4ik / Nestjs-Graphql-Tools

NestJS Graphql Tools is a flexible solution that provides a bunch of decorators for solving problems like n+1 request, filtering, sorting, pagination, polymorphic relation, graphql field extraction. It is fully based on decorators. To use it you can just add a decorator to your resolver.
GNU General Public License v3.0
79 stars 8 forks source link

Mysql error #31

Closed clifinger closed 1 year ago

clifinger commented 1 year ago

Describe the bug I receive: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '::varchar ilike '%Task%'::varchar))' when I use Like filter

To Reproduce Steps to reproduce the behavior:

@Query(() => [CategoryType], { nullable: 'itemsAndList' })
  @GraphqlFilter()
  async allCategories(
    @Filter(() => CategoryType) filter: Brackets,
    @Paginator() paginator: PaginatorArgs,
  ): Promise<CategoryType[]> {
    const qb = this.categoriesRepository.createQueryBuilder('c').where(filter);
    console.log(filter);
    if (paginator) {
      qb.offset(paginator.page * paginator.per_page).limit(paginator.per_page);
    }
    return qb.getMany();
  }
clifinger commented 1 year ago

Do you support only pg ?

Adrinalin4ik commented 1 year ago

For now, yes. Filters and sorting are stable for pg only. I will change this behavior soon.