/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { useMutation, } from "@tanstack/react-query";
import { queryQueryEvents } from "../funcs/queryQueryEvents.js";
import { combineSignals } from "../lib/primitives.js";
import { unwrapAsync } from "../types/fp.js";
import { useInkeepAnalyticsContext } from "./_context.js";
/**
 * Query Events
 */
export function useQueryQueryEventsMutation(options) {
    const client = useInkeepAnalyticsContext();
    return useMutation({
        ...buildQueryQueryEventsMutation(client, options),
        ...options,
    });
}
export function mutationKeyQueryQueryEvents() {
    return ["@inkeep/inkeep-analytics", "Query", "queryEvents"];
}
export function buildQueryQueryEventsMutation(client$, hookOptions) {
    return {
        mutationKey: mutationKeyQueryQueryEvents(),
        mutationFn: function queryQueryEventsMutationFn({ request, options, }) {
            const mergedOptions = {
                ...hookOptions,
                ...options,
                fetchOptions: {
                    ...hookOptions?.fetchOptions,
                    ...options?.fetchOptions,
                    signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
                },
            };
            return unwrapAsync(queryQueryEvents(client$, request, mergedOptions));
        },
    };
}
//# sourceMappingURL=queryQueryEvents.js.map