update playground

This commit is contained in:
Robert Soriano
2022-10-29 21:58:00 -07:00
parent da44e5429f
commit 29909328c4
3 changed files with 34 additions and 5 deletions

View File

@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { inferAsyncReturnType } from '@trpc/server'
import type { H3Event } from 'h3'
export type Context = inferAsyncReturnType<typeof createContext>
/**
* Creates context for an incoming request
* @link https://trpc.io/docs/context
*/
export async function createContext(
opts: H3Event,
) {
// for API-response caching see https://trpc.io/docs/caching
return {}
}

View File

@@ -1,6 +1,7 @@
import { initTRPC } from '@trpc/server'
import type { Context } from './context'
const t = initTRPC.context<any>().create()
const t = initTRPC.context<Context>().create()
/**
* Create a router