Docs
Launch GraphOS Studio
Since 3.9.0

Preloading

Apollo Client preloading API reference


createQueryPreloader
Since 3.9.0

This is in

and is subject to breaking changes.

A higher order function that returns a preloadQuery function which can be used to begin loading a with the given client. This is useful when you want to start loading a as early as possible outside of a React component.

Refer to the

section for a more in-depth overview.

Example

const preloadQuery = createQueryPreloader(client);

Signature

function createQueryPreloader(
client: ApolloClient<any>
): PreloadQueryFunction

Parameters

Name / Type
Description

client

ApolloClient<any>

The ApolloClient instance that will be used to load queries from the returned preloadQuery function.

Result

The `preloadQuery` function.
PreloadQueryFunction
Show/hide child attributes
Previous
Hooks
Next
Testing
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company