feat(deps): bump @trpc/client and @trpc/server to 10.10.0

This commit is contained in:
wobsoriano
2023-02-04 20:59:39 -08:00
parent 7f156806d8
commit f89c8e44ef
4 changed files with 27 additions and 12 deletions

View File

@@ -69,7 +69,7 @@ export function createTRPCNuxtClient<TRouter extends AnyRouter> (opts: CreateTRP
const client = createTRPCProxyClient<TRouter>(opts)
const decoratedClient = createFlatProxy((key) => {
return createNuxtProxyDecoration(key, client)
return createNuxtProxyDecoration(key, client as any)
}) as DecoratedProcedureRecord<TRouter['_def']['record'], TRouter>
return decoratedClient

View File

@@ -4,6 +4,7 @@ import { FetchError } from 'ofetch'
// @ts-expect-error: Nuxt auto-imports
import { useRequestHeaders } from '#imports'
import { type HTTPLinkOptions as _HTTPLinkOptions } from '@trpc/client/dist/links/internals/httpUtils'
import { type FetchEsque } from '@trpc/client/dist/internals/types'
function customFetch(input: RequestInfo | URL, init?: RequestInit) {
return globalThis.$fetch.raw(input.toString(), init)
@@ -43,7 +44,7 @@ export function httpLink<TRouter extends AnyRouter>(opts?: HTTPLinkOptions) {
headers () {
return headers
},
fetch: customFetch,
fetch: customFetch as FetchEsque,
...opts,
})
}
@@ -72,7 +73,7 @@ export function httpBatchLink<TRouter extends AnyRouter>(opts?: HttpBatchLinkOpt
headers () {
return headers
},
fetch: customFetch,
fetch: customFetch as FetchEsque,
...opts,
})
}