Spark
Spark
TtRPC
Created by Spark on 8/31/2024 in #❓-help
calling tRPC procedure from custom link
what is the best way to call a procedure from a custom link? I see in https://github.com/pyncz/trpc-refresh-token-link they are using a helper client. I tried the proxy client approach with await utils.client.auth.refresh.mutate(tokens), but getting Error: Unable to find tRPC Context. Did you forget to wrap your App inside withTRPC HoC?.
4 replies
TtRPC
Created by Spark on 7/2/2024 in #❓-help
tRPC deployed with Amazon API Gateway adapter, SST Ion, and Clerk auth
I am going through this https://ion.sst.dev/docs/start/aws/trpc/, but I don't know the best way to pass auth() from server Next.js to awsLambdaRequestHandler.
return createTRPCContext({
event: ? // pass event.headers: heads?
auth: auth(), // can't do this. idk best way to pass this through to awsLambdaRequestHandler and handle it
});
return createTRPCContext({
event: ? // pass event.headers: heads?
auth: auth(), // can't do this. idk best way to pass this through to awsLambdaRequestHandler and handle it
});
I am doing
headers.set("Authorization", `Bearer ${authToken}`);
headers.set("Authorization", `Bearer ${authToken}`);
for Expo and that is working fine.
2 replies
TtRPC
Created by Spark on 1/30/2024 in #❓-help
optimistic updates tRPC v11 + TanStack Query v5
I am reading https://tanstack.com/query/latest/docs/framework/react/guides/optimistic-updates#if-the-mutation-and-the-query-dont-live-in-the-same-component and I am a bit confused on the best way to implement the optimistic updates 'Via the UI'. How would I access variables from useMutationState?
3 replies