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
// This should be either `useClient` or `client` depending on optionimport{useClient,client}from"client-path";exportfunctionuseFoo(options: {mutation?: UseMutationOptions<...>;client?: Foo['client'];}={},){const{mutation: mutationOptions,client: clientWithParams={}}=options;constclient=useClient(clientWithParams.options);returnuseMutation({mutationFn: async(data)=>{constres=await(clientWithParams.return||client)<...>({method: 'post',url: `...`,
data,
...clientWithParams.parameters,});returnres.data;},
...mutationOptions,});}
// tanstack-query plugin optionstypeOptions={//...client?: {importPath?: stringimportHook?: boolean;// if true - import `useClient` instead of `client`}};
What alternatives have you considered?
Replacing the template.
It seems like the template is a rendered react component which means it's basically non-modifiable, I have to rewrite it from scratch.
It's easier to replace lines by regex after generating.
The text was updated successfully, but these errors were encountered:
What is the problem this feature would solve?
I need to use multiple clients for the same set of
useQuery
/useMutation
generated hooks.External documents/projects?
No response
What is the feature you are proposing to solve the problem?
Currently I have generated code:
I want it be changed to:
What alternatives have you considered?
Replacing the template.
It seems like the template is a rendered react component which means it's basically non-modifiable, I have to rewrite it from scratch.
It's easier to replace lines by regex after generating.
The text was updated successfully, but these errors were encountered: