prisma-nestjs-graphql
prisma-nestjs-graphql copied to clipboard
[Question] Support for @Extensions?
Hello, I am wondering if this could be supported.
https://docs.nestjs.com/graphql/extensions
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