Skip to content

Commit

Permalink
fix(query-builder): make QBFilterQuery type more strict
Browse files Browse the repository at this point in the history
This type was supposed to be accepting only objects, but due to the `FilterQuery` supporting
naked primary keys, it also mistakenly allowed passing strings.

One place where this was a common issue was the `cond` parameter of `qb.leftJoin()`, which
only accepts object conditions.
  • Loading branch information
B4nan committed Sep 8, 2023
1 parent cc0fc5f commit 755ef67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/typings.ts
Expand Up @@ -109,7 +109,7 @@ export type FilterQuery<T> =
| NonNullable<ExpandScalar<Primary<T>>>
| NonNullable<EntityProps<T> & OperatorMap<T>>
| FilterQuery<T>[];
export type QBFilterQuery<T = any> = FilterQuery<T> | Dictionary;
export type QBFilterQuery<T = any> = ObjectQuery<T> | Dictionary;

export interface IWrappedEntity<
T,
Expand Down

0 comments on commit 755ef67

Please sign in to comment.