/**
 * App-scoped PGP-encrypted internal secrets store. No namespace_module dependency and no K8s synchronization. Used by identity_providers_module for OAuth2 client_secret storage.
 * @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 { internalSecretsModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const internalSecretsModuleQueryKey = internalSecretsModuleKeys.detail;
export function useInternalSecretsModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: internalSecretsModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .internalSecretsModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchInternalSecretsModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .internalSecretsModule.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchInternalSecretsModuleQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: internalSecretsModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .internalSecretsModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
