diff --git a/packages/language/src/validators/function-invocation-validator.ts b/packages/language/src/validators/function-invocation-validator.ts index d3bb9e7c..a8666565 100644 --- a/packages/language/src/validators/function-invocation-validator.ts +++ b/packages/language/src/validators/function-invocation-validator.ts @@ -198,7 +198,7 @@ export default class FunctionInvocationValidator implements AstValidator(versionArg); - if (version !== 4 && version !== 7) { + if (version !== undefined && version !== 4 && version !== 7) { accept('error', 'first argument must be 4 or 7', { node: expr.args[0]!, }); @@ -212,7 +212,7 @@ export default class FunctionInvocationValidator implements AstValidator(versionArg); - if (version !== 1 && version !== 2) { + if (version !== undefined && version !== 1 && version !== 2) { accept('error', 'first argument must be 1 or 2', { node: expr.args[0]!, }); diff --git a/samples/sveltekit/src/routes/api/model/[...path]/+server.ts b/samples/sveltekit/src/routes/api/model/[...path]/+server.ts index b3cb654c..1248aa03 100644 --- a/samples/sveltekit/src/routes/api/model/[...path]/+server.ts +++ b/samples/sveltekit/src/routes/api/model/[...path]/+server.ts @@ -5,6 +5,8 @@ import { schema } from "../../../../zenstack/schema"; const handler = SvelteKitRouteHandler({ apiHandler: new RPCApiHandler({ schema }), + // fully open ZenStackClient is used here for demo purposes only, in a real application, + // you should use one with access policies enabled getClient: () => db, });