"use strict";
/**
 * Custom query hook for currentUserId
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.currentUserIdQueryKey = void 0;
exports.useCurrentUserIdQuery = useCurrentUserIdQuery;
exports.fetchCurrentUserIdQuery = fetchCurrentUserIdQuery;
exports.prefetchCurrentUserIdQuery = prefetchCurrentUserIdQuery;
const react_query_1 = require("@tanstack/react-query");
const client_1 = require("../client");
const query_keys_1 = require("../query-keys");
/** Query key factory - re-exported from query-keys.ts */
exports.currentUserIdQueryKey = query_keys_1.customQueryKeys.currentUserId;
function useCurrentUserIdQuery(params) {
    const queryOptions = params ?? {};
    return (0, react_query_1.useQuery)({
        queryKey: (0, exports.currentUserIdQueryKey)(),
        queryFn: () => (0, client_1.getClient)().query.currentUserId().unwrap(),
        ...queryOptions,
    });
}
/**
 * Fetch currentUserId without React hooks
 *
 * @example
 * ```ts
 * const data = await fetchCurrentUserIdQuery();
 * ```
 */
async function fetchCurrentUserIdQuery() {
    return (0, client_1.getClient)().query.currentUserId().unwrap();
}
/**
 * Prefetch currentUserId for SSR or cache warming
 *
 * @example
 * ```ts
 * await prefetchCurrentUserIdQuery(queryClient);
 * ```
 */
async function prefetchCurrentUserIdQuery(queryClient) {
    await queryClient.prefetchQuery({
        queryKey: (0, exports.currentUserIdQueryKey)(),
        queryFn: () => (0, client_1.getClient)().query.currentUserId().unwrap(),
    });
}
