/**
 * Custom query hook for readFunctionGraph
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { customQueryKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const readFunctionGraphQueryKey = customQueryKeys.readFunctionGraph;
export function useReadFunctionGraphQuery(params) {
    const variables = params?.variables ?? {};
    const { variables: _variables, ...queryOptions } = params ?? {};
    void _variables;
    return useQuery({
        queryKey: readFunctionGraphQueryKey(variables),
        queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(),
        ...queryOptions,
    });
}
/**
 * Fetch readFunctionGraph without React hooks
 *
 * @example
 * ```ts
 * const data = await fetchReadFunctionGraphQuery({ variables: { graphId } });
 * ```
 */
export async function fetchReadFunctionGraphQuery(params) {
    const variables = params?.variables ?? {};
    return getClient().query.readFunctionGraph(variables).unwrap();
}
/**
 * Prefetch readFunctionGraph for SSR or cache warming
 *
 * @example
 * ```ts
 * await prefetchReadFunctionGraphQuery(queryClient, { variables: { graphId } });
 * ```
 */
export async function prefetchReadFunctionGraphQuery(queryClient, params) {
    const variables = params?.variables ?? {};
    await queryClient.prefetchQuery({
        queryKey: readFunctionGraphQueryKey(variables),
        queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(),
    });
}
