"use strict";
/**
 * Custom query hook for applyRegistryDefaults
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyRegistryDefaultsQueryKey = void 0;
exports.useApplyRegistryDefaultsQuery = useApplyRegistryDefaultsQuery;
exports.fetchApplyRegistryDefaultsQuery = fetchApplyRegistryDefaultsQuery;
exports.prefetchApplyRegistryDefaultsQuery = prefetchApplyRegistryDefaultsQuery;
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.applyRegistryDefaultsQueryKey = query_keys_1.customQueryKeys.applyRegistryDefaults;
function useApplyRegistryDefaultsQuery(params) {
    const variables = params?.variables ?? {};
    const { variables: _variables, ...queryOptions } = params ?? {};
    void _variables;
    return (0, react_query_1.useQuery)({
        queryKey: (0, exports.applyRegistryDefaultsQueryKey)(variables),
        queryFn: () => (0, client_1.getClient)().query.applyRegistryDefaults(variables).unwrap(),
        ...queryOptions,
    });
}
/**
 * Fetch applyRegistryDefaults without React hooks
 *
 * @example
 * ```ts
 * const data = await fetchApplyRegistryDefaultsQuery({ variables: { data, nodeType } });
 * ```
 */
async function fetchApplyRegistryDefaultsQuery(params) {
    const variables = params?.variables ?? {};
    return (0, client_1.getClient)().query.applyRegistryDefaults(variables).unwrap();
}
/**
 * Prefetch applyRegistryDefaults for SSR or cache warming
 *
 * @example
 * ```ts
 * await prefetchApplyRegistryDefaultsQuery(queryClient, { variables: { data, nodeType } });
 * ```
 */
async function prefetchApplyRegistryDefaultsQuery(queryClient, params) {
    const variables = params?.variables ?? {};
    await queryClient.prefetchQuery({
        queryKey: (0, exports.applyRegistryDefaultsQueryKey)(variables),
        queryFn: () => (0, client_1.getClient)().query.applyRegistryDefaults(variables).unwrap(),
    });
}
