/**
 * Default maximum values for each named limit, applied when no per-actor override exists
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildSelectionArgs } from '../selection';
import { orgLimitDefaultKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const orgLimitDefaultQueryKey = orgLimitDefaultKeys.detail;
export function useOrgLimitDefaultQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: orgLimitDefaultKeys.detail(params.id),
        queryFn: () => getClient()
            .orgLimitDefault.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchOrgLimitDefaultQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .orgLimitDefault.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchOrgLimitDefaultQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: orgLimitDefaultKeys.detail(params.id),
        queryFn: () => getClient()
            .orgLimitDefault.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
