/**
 * Custom query hook for getPathObjectsFromRoot
 * @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 getPathObjectsFromRootQueryKey = customQueryKeys.getPathObjectsFromRoot;
export function useGetPathObjectsFromRootQuery(params) {
    const variables = params?.variables ?? {};
    const { variables: _variables, ...queryOptions } = params ?? {};
    void _variables;
    return useQuery({
        queryKey: getPathObjectsFromRootQueryKey(variables),
        queryFn: () => getClient().query.getPathObjectsFromRoot(variables).unwrap(),
        ...queryOptions,
    });
}
/**
 * Fetch getPathObjectsFromRoot without React hooks
 *
 * @example
 * ```ts
 * const data = await fetchGetPathObjectsFromRootQuery({ variables: { databaseId, id, path, first, offset, after } });
 * ```
 */
export async function fetchGetPathObjectsFromRootQuery(params) {
    const variables = params?.variables ?? {};
    return getClient().query.getPathObjectsFromRoot(variables).unwrap();
}
/**
 * Prefetch getPathObjectsFromRoot for SSR or cache warming
 *
 * @example
 * ```ts
 * await prefetchGetPathObjectsFromRootQuery(queryClient, { variables: { databaseId, id, path, first, offset, after } });
 * ```
 */
export async function prefetchGetPathObjectsFromRootQuery(queryClient, params) {
    const variables = params?.variables ?? {};
    await queryClient.prefetchQuery({
        queryKey: getPathObjectsFromRootQueryKey(variables),
        queryFn: () => getClient().query.getPathObjectsFromRoot(variables).unwrap(),
    });
}
