MCPcopy Index your code
hub / github.com/code-with-antonio/nodebase / prefetch

Function prefetch

src/trpc/server.tsx:19–28  ·  view source on GitHub ↗
(
  queryOptions: T,
)

Source from the content-addressed store, hash-verified

17export const caller = appRouter.createCaller(createTRPCContext);
18
19export function prefetch<T extends ReturnType<TRPCQueryOptions<any>>>(
20 queryOptions: T,
21) {
22 const queryClient = getQueryClient();
23 if (queryOptions.queryKey[1]?.type === 'infinite') {
24 void queryClient.prefetchInfiniteQuery(queryOptions as any);
25 } else {
26 void queryClient.prefetchQuery(queryOptions);
27 }
28}
29
30export function HydrateClient(props: { children: React.ReactNode }) {
31 const queryClient = getQueryClient();

Callers 6

prefetchCredentialsFunction · 0.90
prefetchCredentialFunction · 0.90
prefetchExecutionsFunction · 0.90
prefetchExecutionFunction · 0.90
prefetchWorkflowsFunction · 0.90
prefetchWorkflowFunction · 0.90

Calls 1

getQueryClientFunction · 0.85

Tested by

no test coverage detected