Skip to content

auth() with import causes linking-error #1257

@platon-ivanov

Description

@platon-ivanov

Description and expected behavior
auth() function fields aren't resolved when User model is imported.

Screenshots
image

Environment (please complete the following information):

  • ZenStack version: next
  • Prisma version: 5.5.2
  • Database type: Postgresql

Additional context

user.zmodel:

import "./base"
import "./image"

model User extends Base {
    email String @unique

    @@auth
}

image.zmodel:

import "./user"
import "./base"

model Image extends Base {
    width Int @default(0)
    height Int @default(0)

    @@allow('read', true)
    @@allow('all', auth().role == Admin)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions