/**
 * Config row for the webauthn_credentials_module, which provisions the per-user WebAuthn/passkey credentials table (public key, counter, transports, device type, backup state) mirroring crypto_addresses_module. The sibling webauthn_auth_module holds RP config and the registration/sign-in challenge state.
 * @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 { webauthnCredentialsModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const webauthnCredentialsModulesQueryKey = webauthnCredentialsModuleKeys.list;
export function useWebauthnCredentialsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: webauthnCredentialsModuleKeys.list(args),
        queryFn: () => getClient().webauthnCredentialsModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchWebauthnCredentialsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().webauthnCredentialsModule.findMany(args).unwrap();
}
export async function prefetchWebauthnCredentialsModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: webauthnCredentialsModuleKeys.list(args),
        queryFn: () => getClient().webauthnCredentialsModule.findMany(args).unwrap(),
    });
}
