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