advanced
advanced
Explore posts from servers
TtRPC
Created by advanced on 5/28/2024 in #❓-help
client unable to infer output types
I'm using v11 of trpc in tandem with drizzle on my backend. The client is a react native app. I've spent several hours trying to figure out why my outputs are inferred as Any. when I check the type on the backend I get the correct type so it's only happening on the client. for example product.list is a drizzle query that return an array of product but this is what I get.
type LIST /* LIST is Any */ = RouterOutputs["product"]["list"];

inferRouterOutputs<AppRouter>
type RouterOutputs = {
product: GetInferenceHelpers<"output", {
ctx: any;
meta: object;
errorShape: DefaultErrorShape;
transformer: false;
}, {
list: QueryProcedure<{
input: {
cursor: number;
pageSize: number;
};
output: any;
}>;
}>;
user: GetInferenceHelpers<...>;
}
type LIST /* LIST is Any */ = RouterOutputs["product"]["list"];

inferRouterOutputs<AppRouter>
type RouterOutputs = {
product: GetInferenceHelpers<"output", {
ctx: any;
meta: object;
errorShape: DefaultErrorShape;
transformer: false;
}, {
list: QueryProcedure<{
input: {
cursor: number;
pageSize: number;
};
output: any;
}>;
}>;
user: GetInferenceHelpers<...>;
}
if I create a simple proc that return an array or a string it is inferred correctly. for more detail about the stack I'm on vscode ts 5.4.5 trpc/client 11.0.0-rc.377 trpc/react-query 11.0.0-rc.377 drizzle-orm 0.30.10
3 replies
CDCloudflare Developers
Created by advanced on 1/27/2024 in #workers-help
I have a question about worker services bindings.
let's say I have serverA and serviceB. Will serviceB be loaded even tough serviceA did not call it explicitly? I'm asking this because if serviceB is quite heavy I would like to avoid launching serviceB and slow down serviceA where most calls do not require it.
3 replies