/**
 * List query hook for PlatformResourcesHealth
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildListSelectionArgs } from '../selection';
import { platformResourcesHealthKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const platformResourcesHealthsQueryKey = platformResourcesHealthKeys.list;
export function usePlatformResourcesHealthsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: platformResourcesHealthKeys.list(args),
        queryFn: () => getClient().platformResourcesHealth.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPlatformResourcesHealthsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().platformResourcesHealth.findMany(args).unwrap();
}
export async function prefetchPlatformResourcesHealthsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: platformResourcesHealthKeys.list(args),
        queryFn: () => getClient().platformResourcesHealth.findMany(args).unwrap(),
    });
}
