Open ghost opened 2 years ago
I think it has too dynamic nature.
@Field({ middleware: [checkRoleMiddleware] })
@Extensions({ role: Role.ADMIN })
password: string;
We need to import Role
, checkRoleMiddleware
...
I would make model as abstract (see https://github.com/unlight/prisma-nestjs-graphql#objecttype), then add own decorators, see https://docs.nestjs.com/graphql/resolvers#generics
@unlight How I can mark Input classes as abstract? I'm looking for a solution to restrict create/connectOrCreate/delete/disconnect/upsert operations depending on user access and his roles
@asanovr Check https://github.com/unlight/prisma-nestjs-graphql#objecttype
Hello, I am wondering if this could be supported.
https://docs.nestjs.com/graphql/extensions