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
Is your feature request related to a problem? Please describe.
I cannot use a hook outside a component. This is not ideal when I use react router loaders.
Describe the solution you'd like
// Current query definitionexportconstuseContactDetailsServiceGetContactDetails=({ client },queryKey?,options?)=>useQuery({queryKey: Common.UseContactDetailsServiceGetContactDetailsKeyFn({ client },queryKey),queryFn: ()=>ContactDetailsService.getContactDetails({ client }), ...options});// New query definition OptionexportconstUseContactDetailsSimpleServiceGetContactDetails=async(queryClient,{ client },queryKey?,options?)=>awaitqueryClient.ensureQueryData({queryKey: Common.UseContactDetailsServiceGetContactDetailsKeyFn({ client },queryKey),queryFn: ()=>ContactDetailsService.getContactDetails({ client }),})// This will allow me to do thisexportconstloader=(queryClient)=>async({ params })=>{returnawaitUseContactDetailsSimpleServiceGetContactDetails(queryClient,{params.client })}
Adding a cli option to generate one type of query or both can be added.
Describe alternatives you've considered
Manually creating the new query definition
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I cannot use a hook outside a component. This is not ideal when I use react router loaders.
Describe the solution you'd like
Describe alternatives you've considered
Manually creating the new query definition
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: