-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Currently, I'm prefetching data in a server component so it can later be used in a client component. But creating the code is a manual process that could be easier if we have helpers (similar to the hooks).
Describe the solution you'd like
It would be nice to have something like:
await useFooServiceFindOnePrefetch(//...keys); // or await prefetchFooServiceFindOne(//...keys)
Instead of building it from scratch:
await queryClient.prefetchQuery({
queryKey: [
useFooServiceFindOnePrefetchKey,
// more keys
],
queryFn: () => {
return FooService.findOne(//...keys);
},
});
Any chance to consider this?
Describe alternatives you've considered
N/A
Additional context
I'm prefetching data using the guidelines from here
seriouslag
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request