-
-
Notifications
You must be signed in to change notification settings - Fork 495
Labels
axiosAxios related issueAxios related issuetanstack-queryTanStack Query related issueTanStack Query related issue
Milestone
Description
Hey, first of all, this package seems really awesome and we currently have a very large manually maintained api package that has all of our typesafe code, which this package could completely make redundant, which would be a huge time saver!
I am struggling a bit with the docs here - If I wanted to have each of the endpoint-generated axios-functions to have a custom axios instance passed to it as a parameter, is that the job for a custom mutator?
What I am going for is something like this:
export const getPets = (axiosInstance: axiosInstance) => {
/**
* List all pets.
* @summary GET pets
*/
const petsIndex = <TData = AxiosResponse<PetsIndex200>>(
params?: PetsIndexParams,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axiosInstance.get(`/pets`, {
...options,
params: { ...params, ...options?.params },
});
};
}where axiosInstance is something I can pass into the request
Thanks
Metadata
Metadata
Assignees
Labels
axiosAxios related issueAxios related issuetanstack-queryTanStack Query related issueTanStack Query related issue