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
/** * Generated by orval v6.22.0 🍺 * Do not edit manually. * Api * OpenAPI spec version: 1.0 */importtype{QueryKey}from'@tanstack/react-query';importaxiosfrom'axios';importtype{AxiosRequestConfig,AxiosResponse}from'axios';exportconstgetInventory=(options?: AxiosRequestConfig): Promise<AxiosResponse<void>>=>{returnaxios.post(`/queries/inventory`,undefined,options);};exportconstgetGetInventoryQueryKey=()=>{return[`/queries/inventory`]asconst;};
What were you expecting to happen?
In 6.21.0, this code was generated:
/** * Generated by orval v6.21.0 🍺 * Do not edit manually. * Api * OpenAPI spec version: 1.0 */import{useQuery}from'@tanstack/react-query';importtype{QueryFunction,QueryKey,UseQueryOptions,UseQueryResult}from'@tanstack/react-query';importaxiosfrom'axios';importtype{AxiosError,AxiosRequestConfig,AxiosResponse}from'axios';exportconstgetInventory=(options?: AxiosRequestConfig): Promise<AxiosResponse<void>>=>{returnaxios.post(`/queries/inventory`,undefined,options);};exportconstgetGetInventoryQueryKey=()=>{return[`/queries/inventory`]asconst;};exportconstgetGetInventoryQueryOptions=<TData=Awaited<ReturnType<typeofgetInventory>>,TError=AxiosError<unknown>,>(options?: {query?: Partial<UseQueryOptions<Awaited<ReturnType<typeofgetInventory>>,TError,TData>>;axios?: AxiosRequestConfig;})=>{const{query: queryOptions,axios: axiosOptions}=options??{};constqueryKey=queryOptions?.queryKey??getGetInventoryQueryKey();constqueryFn: QueryFunction<Awaited<ReturnType<typeofgetInventory>>>=({ signal })=>getInventory({ signal, ...axiosOptions});return{queryKey, queryFn, ...queryOptions}asUseQueryOptions<Awaited<ReturnType<typeofgetInventory>>,TError,TData>&{queryKey: QueryKey};};exporttypeGetInventoryQueryResult=NonNullable<Awaited<ReturnType<typeofgetInventory>>>;exporttypeGetInventoryQueryError=AxiosError<unknown>;exportconstuseGetInventory=<TData=Awaited<ReturnType<typeofgetInventory>>,TError=AxiosError<unknown>,>(options?: {query?: Partial<UseQueryOptions<Awaited<ReturnType<typeofgetInventory>>,TError,TData>>;axios?: AxiosRequestConfig;}): UseQueryResult<TData,TError>&{queryKey: QueryKey}=>{const queryOptions =getGetInventoryQueryOptions(options);constquery=useQuery(queryOptions)asUseQueryResult<TData,TError>&{queryKey: QueryKey};query.queryKey =queryOptions.queryKey;returnquery;};
Any logs, error output, etc?
nope
Any other comments?
In our Api, we have multiple quering-endpoints using the POST-http verb. We want the generated code to behave as if they were GET-requests. We did this by tagging these endpoints with the Query, which we then look for in the transformer supplied in the orval.config
From orval 6.22.0 and on, this method of generating query-like operations in orval for POST-endpoints, doesn't work anymore.
What versions are you using?
Operating System: Windows 11 Package Version: 6.21.0 (working) and 6.22.0 and above (not working) Browser Version: Not applicable
The text was updated successfully, but these errors were encountered:
The transformer defined in the config above is a workaround for an issue discussed here: #730
This issue is now solved, however, upgrading to 6.25 does not solve the original issue, nor this one.
What are the steps to reproduce this issue?
orval
commandWhat happens?
This code is generated
What were you expecting to happen?
In 6.21.0, this code was generated:
Any logs, error output, etc?
nope
Any other comments?
In our Api, we have multiple quering-endpoints using the POST-http verb. We want the generated code to behave as if they were GET-requests. We did this by tagging these endpoints with the
Query
, which we then look for in the transformer supplied in theorval.config
From orval 6.22.0 and on, this method of generating query-like operations in orval for POST-endpoints, doesn't work anymore.
What versions are you using?
Operating System: Windows 11
Package Version: 6.21.0 (working) and 6.22.0 and above (not working)
Browser Version: Not applicable
The text was updated successfully, but these errors were encountered: