/**
 * List query hook for OrgGetSubordinatesRecord
 * @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 { orgGetSubordinatesRecordKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const orgGetSubordinatesQueryKey = orgGetSubordinatesRecordKeys.list;
export function useOrgGetSubordinatesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: orgGetSubordinatesRecordKeys.list(args),
        queryFn: () => getClient().orgGetSubordinatesRecord.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchOrgGetSubordinatesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().orgGetSubordinatesRecord.findMany(args).unwrap();
}
export async function prefetchOrgGetSubordinatesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: orgGetSubordinatesRecordKeys.list(args),
        queryFn: () => getClient().orgGetSubordinatesRecord.findMany(args).unwrap(),
    });
}
