Skip to content

Commit 37519c9

Browse files
committed
minor fixes
1 parent 15d00d4 commit 37519c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime/src/plugins/policy/expression-transformer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ export class ExpressionTransformer<Schema extends SchemaDef> {
198198
private normalizeBinaryOperationOperands(expr: BinaryExpression, context: ExpressionTransformerContext<Schema>) {
199199
let normalizedLeft: Expression = expr.left;
200200
if (this.isRelationField(expr.left, context.model)) {
201-
invariant(ExpressionUtils.isNull(expr.right));
201+
invariant(ExpressionUtils.isNull(expr.right), 'only null comparison is supported for relation field');
202202
const idFields = getIdFields(this.schema, context.model);
203203
normalizedLeft = this.makeOrAppendMember(normalizedLeft, idFields[0]!);
204204
}
205205
let normalizedRight: Expression = expr.right;
206206
if (this.isRelationField(expr.right, context.model)) {
207-
invariant(ExpressionUtils.isNull(expr.left));
207+
invariant(ExpressionUtils.isNull(expr.left), 'only null comparison is supported for relation field');
208208
const idFields = getIdFields(this.schema, context.model);
209209
normalizedRight = this.makeOrAppendMember(normalizedRight, idFields[0]!);
210210
}

0 commit comments

Comments
 (0)