/**
 * Namespace-backed plaintext key-value config module. Requires namespace_module and emits namespace:sync_config job triggers for K8s ConfigMap synchronization.
 * @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 { infraConfigModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const infraConfigModulesQueryKey = infraConfigModuleKeys.list;
export function useInfraConfigModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: infraConfigModuleKeys.list(args),
        queryFn: () => getClient().infraConfigModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchInfraConfigModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().infraConfigModule.findMany(args).unwrap();
}
export async function prefetchInfraConfigModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: infraConfigModuleKeys.list(args),
        queryFn: () => getClient().infraConfigModule.findMany(args).unwrap(),
    });
}
