/**
 * Per-user bcrypt credential store (password hashes, API key hashes).
     Always user-scoped with AuthzDirectOwner RLS. Consumed by user_auth_module,
     identity_providers_module, and bootstrap procedures.
 * @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 { userCredentialsModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const userCredentialsModulesQueryKey = userCredentialsModuleKeys.list;
export function useUserCredentialsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: userCredentialsModuleKeys.list(args),
        queryFn: () => getClient().userCredentialsModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchUserCredentialsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().userCredentialsModule.findMany(args).unwrap();
}
export async function prefetchUserCredentialsModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: userCredentialsModuleKeys.list(args),
        queryFn: () => getClient().userCredentialsModule.findMany(args).unwrap(),
    });
}
