"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useQueryQueryEventsMutation = useQueryQueryEventsMutation;
exports.mutationKeyQueryQueryEvents = mutationKeyQueryQueryEvents;
exports.buildQueryQueryEventsMutation = buildQueryQueryEventsMutation;
const react_query_1 = require("@tanstack/react-query");
const queryQueryEvents_js_1 = require("../funcs/queryQueryEvents.js");
const primitives_js_1 = require("../lib/primitives.js");
const fp_js_1 = require("../types/fp.js");
const _context_js_1 = require("./_context.js");
/**
 * Query Events
 */
function useQueryQueryEventsMutation(options) {
    const client = (0, _context_js_1.useInkeepAnalyticsContext)();
    return (0, react_query_1.useMutation)({
        ...buildQueryQueryEventsMutation(client, options),
        ...options,
    });
}
function mutationKeyQueryQueryEvents() {
    return ["@inkeep/inkeep-analytics", "Query", "queryEvents"];
}
function buildQueryQueryEventsMutation(client$, hookOptions) {
    return {
        mutationKey: mutationKeyQueryQueryEvents(),
        mutationFn: function queryQueryEventsMutationFn({ request, options, }) {
            const mergedOptions = {
                ...hookOptions,
                ...options,
                fetchOptions: {
                    ...hookOptions?.fetchOptions,
                    ...options?.fetchOptions,
                    signal: (0, primitives_js_1.combineSignals)(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
                },
            };
            return (0, fp_js_1.unwrapAsync)((0, queryQueryEvents_js_1.queryQueryEvents)(client$, request, mergedOptions));
        },
    };
}
//# sourceMappingURL=queryQueryEvents.js.map