Files
WebAdmin3.0/server/trpc/context.ts
2023-04-11 15:08:56 +02:00

19 lines
498 B
TypeScript

import { inferAsyncReturnType } from '@trpc/server'
import type { H3Event } from 'h3'
/**
* Creates context for an incoming request
* @link https://trpc.io/docs/context
*/
export function createContext (_event: H3Event) {
/**
* Add any trpc-request context here. E.g., you could add `prisma` like this (if you've added it via sidebase):
* ```ts
* return { prisma: _event.context.prisma }
* ```
*/
return {}
}
export type Context = inferAsyncReturnType<typeof createContext>