Skip to main content
Version: 2.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,
}
);

Argumentsโ€‹

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

Returnsโ€‹

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