Skip to content

Version 0.9.1

Compare
Choose a tag to compare
@Adrinalin4ik Adrinalin4ik released this 07 Jun 06:46
· 18 commits to master since this release
  • Updated dependencies
  • Added feature presented in the issue #34
  • Added raw filters and sorting

Raw filters

Raw filters allow to get access to the user provided raw value right from the code. This feature allows to build your own filters interpreters.

How to use raw filters:

  1. Add @Filter({ raw: true }) parameter with type of RawFilterArgs<T> where T is your filter type
  2. @Filter() will return raw filter data.
@Query(() => [UserObjectType])
async usersRaw(
  @Filter(() => [UserObjectType, UserFilterInputType], {sqlAlias: 'u', raw: true}) filter: RawFilterArgs<UserObjectType & UserFilterInputType>,
  @Paginator() paginator: PaginatorArgs
) {
  // Your customer filter logic..
  return [];
}

Raw sorting

Raw sorting allows to get access to the user provided raw value right from the code. This feature allows to build your own sorting interpreters.

How to use raw filters:

  1. Add @Sorting({ raw: true }) parameter with type of RawSortingArgs<T> where T is your filter type
  2. @Sorting() will return raw sorting data.
@Query(() => [UserObjectType])
async usersRaw(
  @Sorting(() => [UserObjectType], { sqlAlias: 'u', raw: true}) sorting: RawSortingArgs<UserObjectType>,
  @Paginator() paginator: PaginatorArgs
) {
  // Your customer filter logic..
  return [];
}