Open
Description
Query client params type should be dynamically assigned through the openapi path params
Temporary we add // @ts-expect-error to suppress ts check.
In the future, we will find a way to pass right type assertion for query params.
this issue is for all createFetchingHook with @tanstack/react-query
function createMetadataFetchingHook<K extends keyof paths>(path: K) {
return function ({ params, reactQuery }: UseSuspenseQueryOptions<paths[typeof path]['get']>) {
return useSuspenseQuery({
...reactQuery,
queryKey: [path, params],
queryFn: async ({ signal }) => {
// @ts-expect-error: params is dynamic type type for openapi-fetch
const { data } = await client.GET(path, { params, signal });
return data;
},
});
};
}