-
-
Notifications
You must be signed in to change notification settings - Fork 559
Closed
Labels
questionFurther information is requestedFurther information is requestedtanstack-queryTanStack Query related issueTanStack Query related issue
Description
Introduction
Hi, I am quite new to orval. Is there yet any possibility to generate the loader func for react query too?
As described here, react-query could have some loader func. These will check if a data might already be in the query data and if not it will fetch them.
The example of the link:
export const loader =
(queryClient) =>
async ({ params }) => {
const query = contactDetailQuery(params.contactId)
// ⬇️ return data or fetch it
return (
queryClient.getQueryData(query.queryKey) ??
(await queryClient.fetchQuery(query))
)
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requestedtanstack-queryTanStack Query related issueTanStack Query related issue