UNPKG

@ladislaogarcia/prisma-trpc-generator

Version:

Prisma 2+ generator to emit fully implemented tRPC routers

13 lines (10 loc) 274 B
import { shield, rule } from 'trpc-shield'; import { Context } from './context'; export const isAuthenticated = rule<Context>()( async (ctx) => ctx.user !== null, ); export const permissions = shield<Context>({ mutation: { createOneBook: isAuthenticated, }, });