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