/**
 * 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 { buildSelectionArgs } from '../selection';
import { webauthnCredentialsModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const webauthnCredentialsModuleQueryKey = webauthnCredentialsModuleKeys.detail;
export function useWebauthnCredentialsModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: webauthnCredentialsModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .webauthnCredentialsModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchWebauthnCredentialsModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .webauthnCredentialsModule.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchWebauthnCredentialsModuleQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: webauthnCredentialsModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .webauthnCredentialsModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
