You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The router has a generated function that turns an AnyRoute object into what we need:
function preloadRoute(route: AnyRoute, shouldFetch: ShouldFetch): RouteState {
switch (route.kind) {
case 'Query.PetDetailPage': {
// pseudo code here
const entrypointImport = import('../__isograph/Query/PetDetailPage/entrypoint.tsx')
entrypointImport.then(value => makeNetworkRequest(value.entrypoint);
return entrypointImport;
}
}
}
Certain entrypoints can be pre-loaded (i.e. hard required) in the router if you choose
In particular, we can probably pre-fetch: nothing, just the NetworkRequestInfo (with or without normalization Ast), the NetworkRequestInfo and the readerWithRefetchQueries, etc.
THIS WILL BE SO GOOD
The text was updated successfully, but these errors were encountered:
This is a sketch of how routing in Isograph might work.
entrypoint Query.PetDetailPage($id: ID!)
associated withpet/:id
.creating an instance of this type is assumed to be cheap. i.e. doing so doesn't send a network request!
navigateToEntrypoint
function, e.g.:THIS WILL BE SO GOOD
The text was updated successfully, but these errors were encountered: