/**
 * 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 { appLimitDefaultKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const appLimitDefaultQueryKey = appLimitDefaultKeys.detail;
export function useAppLimitDefaultQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: appLimitDefaultKeys.detail(params.id),
        queryFn: () => getClient()
            .appLimitDefault.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchAppLimitDefaultQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .appLimitDefault.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchAppLimitDefaultQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: appLimitDefaultKeys.detail(params.id),
        queryFn: () => getClient()
            .appLimitDefault.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
