/**
 * WebAuthn/passkey credentials owned by users. One row per registered authenticator (security key, device biometric, synced passkey). Schema mirrors SimpleWebAuthn's canonical Passkey object.
 * @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 { webauthnCredentialKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const webauthnCredentialQueryKey = webauthnCredentialKeys.detail;
export function useWebauthnCredentialQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: webauthnCredentialKeys.detail(params.id),
        queryFn: () => getClient()
            .webauthnCredential.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchWebauthnCredentialQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .webauthnCredential.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchWebauthnCredentialQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: webauthnCredentialKeys.detail(params.id),
        queryFn: () => getClient()
            .webauthnCredential.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
