/**
 * One row per cert-bearing host or wildcard; tracks domain verification and TLS provisioning independently of services_public.domains. Reconcilers match a route's root domain to a row here by string (no FK/coupling in v1)
 * @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 { managedDomainKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const managedDomainsQueryKey = managedDomainKeys.list;
export function useManagedDomainsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: managedDomainKeys.list(args),
        queryFn: () => getClient().managedDomain.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchManagedDomainsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().managedDomain.findMany(args).unwrap();
}
export async function prefetchManagedDomainsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: managedDomainKeys.list(args),
        queryFn: () => getClient().managedDomain.findMany(args).unwrap(),
    });
}
