pedro
pedro
Explore posts from servers
TtRPC
Created by pedro on 3/13/2024 in #❓-help
How to not prefetch on getServerSideProps if it's already fetched?
I have a getServerSideProps that utilizes createServerSideHelpers, and when I access a page I prefetch ~10 queries. But this is extremely slow, is there a way to only prefetch once, and if it's in cache don't prefetch?
2 replies
TtRPC
Created by pedro on 10/25/2023 in #❓-help
Vanilla Client Authentication
How to authenticate using the vanilla client? I want to consume this route as the authenticated user, but I couldn't find how to do this. Everything's working fine but this. Couldn't find anything on the docs
export const edgeClient = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: `${getBaseUrl()}/api/trpc`,
}),
],
transformer: SuperJSON,
});
export const edgeClient = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: `${getBaseUrl()}/api/trpc`,
}),
],
transformer: SuperJSON,
});
const introspect = await edgeClient.dataset.introspect.query(
{
datasetId: datasourceId,
workspaceId,
},
{
context: {
session,
},
},
);
const introspect = await edgeClient.dataset.introspect.query(
{
datasetId: datasourceId,
workspaceId,
},
{
context: {
session,
},
},
);
2 replies