Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Resolver(() => SortableEntity)
export class SortingResolver {
constructor() {
// Array.of(50).map(() => SortableEntity.insert({}))
}
@Query(() => String)
@Sortable(() => SortableEntity)
public async sortableEntities(
@OrderOptions() order: TypeORMOrdering
) {
return JSON.stringify(order)
}
@RelayedQuery(() => SortableEntity)
public async sortableEntitiesRelayed() {
return SortableEntity.findAndCount({})
}
}