/**
 * List query hook for PhoneNumbersModule
 * @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 { phoneNumbersModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const phoneNumbersModulesQueryKey = phoneNumbersModuleKeys.list;
export function usePhoneNumbersModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: phoneNumbersModuleKeys.list(args),
        queryFn: () => getClient().phoneNumbersModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPhoneNumbersModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().phoneNumbersModule.findMany(args).unwrap();
}
export async function prefetchPhoneNumbersModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: phoneNumbersModuleKeys.list(args),
        queryFn: () => getClient().phoneNumbersModule.findMany(args).unwrap(),
    });
}
