/**
 * Raw resource usage log — interval-accounting measurements from heartbeats (self) and the reconciler (observer)
 * @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 { resourceUsageLogKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const resourceUsageLogsQueryKey = resourceUsageLogKeys.list;
export function useResourceUsageLogsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: resourceUsageLogKeys.list(args),
        queryFn: () => getClient().resourceUsageLog.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchResourceUsageLogsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().resourceUsageLog.findMany(args).unwrap();
}
export async function prefetchResourceUsageLogsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: resourceUsageLogKeys.list(args),
        queryFn: () => getClient().resourceUsageLog.findMany(args).unwrap(),
    });
}
