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