Skip to content

Commit 747de0e

Browse files
committed
Fix: Add support for typeorm find operators
1 parent 51868fe commit 747de0e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/common/graphql/utils/processWhere.ts

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BadRequestException } from '@nestjs/common';
22

33
import {
44
Between,
5+
FindOperator,
56
FindOptionsWhere,
67
ILike,
78
In,
@@ -99,6 +100,11 @@ function goDeep<T>(
99100
const thisKey = Object.keys(filters)[0];
100101
let nextObject = filters[Object.keys(filters)[0]];
101102

103+
// Check if next item is typeorm find operator
104+
if (nextObject instanceof FindOperator) {
105+
return { [thisKey]: nextObject };
106+
}
107+
102108
// Check if this item is on bottom
103109
if (!isPlainObject(nextObject)) {
104110
// In case use null as value

0 commit comments

Comments
 (0)