Skip to content

Commit

Permalink
refactor(ui): Prepend unused query keys with an underscore
Browse files Browse the repository at this point in the history
There is a bug [1] in the codegen tool that causes it to generate unused
query keys for requests with no parameters. This commit renames the
unused query keys to start with an underscore '_' to pass the lint
checks for unused variables.

NOTE: This is not a lasting solution, as every regeneration of the query
client will revert these changes.

[1]: 7nohe/openapi-react-query-codegen#112

Signed-off-by: Jyrki Keisala <[email protected]>
  • Loading branch information
Etsija committed May 16, 2024
1 parent 74cdc43 commit c711c49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/src/api/queries/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as Common from "./common";
* @returns Liveness Success
* @throws ApiError
*/
export const useHealthServiceGetLiveness = <TData = Common.HealthServiceGetLivenessDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options });
export const useHealthServiceGetLiveness = <TData = Common.HealthServiceGetLivenessDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(_queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options });
/**
* Download a report of an ORT run using a token. This endpoint does not require authentication.
* @param data The data for the request.
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/queries/suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as Common from "./common";
* @returns Liveness Success
* @throws ApiError
*/
export const useHealthServiceGetLivenessSuspense = <TData = Common.HealthServiceGetLivenessDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options });
export const useHealthServiceGetLivenessSuspense = <TData = Common.HealthServiceGetLivenessDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>(_queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options });
/**
* Download a report of an ORT run using a token. This endpoint does not require authentication.
* @param data The data for the request.
Expand Down

0 comments on commit c711c49

Please sign in to comment.