ferdy
ferdy
Explore posts from servers
TtRPC
Created by ferdy on 7/19/2023 in #❓-help
trpc client request size limits?
the request never makes it to the server, so somewhere the trpc client is trying to parse the request for some reason and i think having it too big makes it introduce a funky token?
2 replies
TtRPC
Created by ferdy on 5/4/2023 in #❓-help
Get tRPC procedure latency?
a middleware will only run before a procedure right?
7 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
i do everything through cdk, specifically using NodejsFunction
55 replies
TTCTheo's Typesafe Cult
Created by ferdy on 4/24/2023 in #questions
Nested keyof
ok looks like I can get what i want using lodash: https://lodash.com/docs/4.17.15#set (problem being that indexing into an object with a nested property can't be done like obj["a.b.c"]) gonna mark as solved
2 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
ohh no it wasnt. I didn't do the initial setup of this codebase, didn't even notice strict wasnt on. Enabling strict mode and removing the extra <Context> works, compile-wise -- not sure yet about runtime
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
also fixed having to supply a transformer
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
ok I got it working -- truly dont understand this yet but adding Context to the type parameter of create did the trick:
export const createContext = ({event, context}: CreateAWSLambdaContextOptions<APIGatewayProxyEventV2>) => ({});
type Context = inferAsyncReturnType<typeof createContext>;

const t = initTRPC.context<Context>().create<Context>();
export const createContext = ({event, context}: CreateAWSLambdaContextOptions<APIGatewayProxyEventV2>) => ({});
type Context = inferAsyncReturnType<typeof createContext>;

const t = initTRPC.context<Context>().create<Context>();
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
it definitely could be an apig oddity, though I can see it in the console returning the json response correctly. Maybe I need to find somewhere in between that I can inspect to see where that response is getting lost... Like a debug log from the trpc client or something
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
it's just the return value isn't getting processed correctly
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
yep. and I tested out calling the api directly in my aws console, confirmed its working. Also confirmed that the lambda is getting invoked when I call it from the client by double checking logs
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
I was able to pass in superjson and get around the error, but then the response from my lambda was coming back undefined -- I was wondering if the default transformer would've just handled the response correctly
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
no luck with that
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
ok ill search around as well
55 replies
TtRPC
Created by ferdy on 3/6/2023 in #❓-help
trpc + AWS Lambda (through cdk)
"@trpc/server": "^10.14.0",
"@trpc/client": "^10.14.0",
"@trpc/server": "^10.14.0",
"@trpc/client": "^10.14.0",
55 replies