/**
 * Append-only ledger of code redemptions; AFTER INSERT trigger validates and cascades to limit_credits
 * @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 { appLimitCreditRedemptionKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const appLimitCreditRedemptionsQueryKey = appLimitCreditRedemptionKeys.list;
export function useAppLimitCreditRedemptionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: appLimitCreditRedemptionKeys.list(args),
        queryFn: () => getClient().appLimitCreditRedemption.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchAppLimitCreditRedemptionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().appLimitCreditRedemption.findMany(args).unwrap();
}
export async function prefetchAppLimitCreditRedemptionsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: appLimitCreditRedemptionKeys.list(args),
        queryFn: () => getClient().appLimitCreditRedemption.findMany(args).unwrap(),
    });
}
