Skip to main content
Version: 1.x

prefetchQuery(...)

The method allows you to fetch data and cache it before it's needed. To understand how prefetchQuery handles data and cache management, refer to the TanStack queryClient.prefetchQuery 🌴 documentation.

const result = qraft.<service>.<operation>.prefetchQuery(
{
parameters,
requestFn,
baseUrl,
...prefetchQueryOptions,
},
queryClient
);

Arguments​

See fetchQuery(...) for the full list of arguments.

Returns​

Promise<void> - a promise that resolves when the query is successfully cached