fix: h3 CompatibilityEvent

This commit is contained in:
Mahdi Boomeri
2022-10-21 16:56:09 +03:30
parent 92747711c6
commit 4ed504e1e9
4 changed files with 9 additions and 9 deletions

View File

@@ -7,11 +7,11 @@ The `createContext`-function is called for each incoming request so here you can
```ts
// ~/server/trpc/index.ts
import type { inferAsyncReturnType } from '@trpc/server'
import type { CompatibilityEvent } from 'h3'
import type { H3Event } from 'h3'
import { decodeAndVerifyJwtToken } from '~/somewhere/in/your/app/utils'
// The app's context - is generated for each incoming request
export async function createContext({ req }: CompatibilityEvent) {
export async function createContext({ req }: H3Event) {
// Create your context based on the request object
// Will be available as `ctx` in all your resolvers