Skip to content

Commit ac3206b

Browse files
authored
merge dev to main (v1.2.0) (#801)
2 parents 324f402 + d9e5b23 commit ac3206b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/schema/src/language-server/validator/expression-validator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export default class ExpressionValidator implements AstValidator<Expression> {
2121
if (!expr.$resolvedType) {
2222
if (isAuthInvocation(expr)) {
2323
// check was done at link time
24-
accept('error', 'auth() cannot be resolved because no "User" model is defined', { node: expr });
24+
accept(
25+
'error',
26+
'auth() cannot be resolved because no model marked wth "@@auth()" or named "User" is found',
27+
{ node: expr }
28+
);
2529
} else if (isCollectionPredicate(expr)) {
2630
accept('error', 'collection predicate can only be used on an array of model type', { node: expr });
2731
} else {

packages/schema/tests/schema/validation/attribute-validation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ describe('Attribute tests', () => {
987987
@@allow('all', auth() != null)
988988
}
989989
`)
990-
).toContain(`auth() cannot be resolved because no "User" model is defined`);
990+
).toContain(`auth() cannot be resolved because no model marked wth "@@auth()" or named "User" is found`);
991991

992992
await loadModel(`
993993
${prelude}

0 commit comments

Comments
 (0)