Skip to content

Access policy cause the Prisma runtime validation error #704

Closed
@jiashengguo

Description

@jiashengguo

Use the below zmodel schema file:
https://github.com/noufalr/open/blob/main/schema.zmodel

running the below code:

    const client = enhance(prisma, { user: { id: 1 } };
    const myCorseIds = [randomUUID()];
    const result = await client.enrollment.count({
        where: {
            course_id: {
                in: myCorseIds,
            },
        },
    });

It shows the error in my machine:

Argument `id`: Invalid value provided. Expected StringFilter or String, provided Int.
    at /Users/jiasheng/branch/my-try-prisma/src/zen.ts:10:44,
    at step (/Users/jiasheng/branch/my-try-prisma/src/zen.ts:33:23),
    at Object.next (/Users/jiasheng/branch/my-try-prisma/src/zen.ts:14:53),
    at /Users/jiasheng/branch/my-try-prisma/src/zen.ts:8:71,
    at new Promise (<anonymous>),
    at __awaiter (/Users/jiasheng/branch/my-try-prisma/src/zen.ts:4:12),
    at bookSeat (/Users/jiasheng/branch/my-try-prisma/src/zen.ts:44:12),
    at /Users/jiasheng/branch/my-try-prisma/src/zen.ts:22:11,
    at step (/Users/jiasheng/branch/my-try-prisma/src/zen.ts:33:23) {
  name: 'PrismaClientValidationError',
  clientVersion: '5.2.0',

But according to the customer, the error is:

Unknown argument `is`. Available options are listed in green.
    at load (D:/Dev/Repos/lmsapp/src/routes/(app)/courses/+page.server.ts:40:57),
    at async Module.load_server_data (D:/Dev/Repos/lmsapp/node_modules/@sveltejs/kit/src/runtime/server/page/load_data.js:57:17),
    at async eval (D:/Dev/Repos/lmsapp/node_modules/@sveltejs/kit/src/runtime/server/page/index.js:150:13) {
  name: 'PrismaClientValidationError',
  clientVersion: '5.3.1',

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions