-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Using generateReactQueryComponents(), the following is generated:
export const fetchDeleteFile = (
variables: DeleteFileVariables,
signal?: AbortSignal,
) =>
fetch<
string,
DeleteFileError,
undefined,
DeleteFileHeaders,
{},
DeleteFilePathParams
>({
url: '/v1/activities/file/{blobName}',
method: 'delete',
...variables,
signal,
});In the above code, there's no way for me to access the URL (/v1/activities/file/{blobName}) for that endpoint.
It would be very useful if we could do this instead:
export const deleteFileOperation = {
url: '/v1/activities/file/{blobName}',
method: 'delete',
};
export const fetchDeleteFile = (
variables: DeleteFileVariables,
signal?: AbortSignal,
) =>
fetch<
string,
DeleteFileError,
undefined,
DeleteFileHeaders,
{},
DeleteFilePathParams
>({
...deleteFileOperation,
...variables,
signal,
});This allows me to access the endpoint metadata.
Use Case:
I need to build a custom react-query hook that uses XMLHttpRequest (for file uploads), but i have to hard code the endpoint URL, instead of referencing the URL in generated code.
Metadata
Metadata
Assignees
Labels
No labels