/**
 * Unified skills and knowledge resources for agent retrieval
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildSelectionArgs } from '../selection';
import { agentResourceKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const agentResourceQueryKey = agentResourceKeys.detail;
export function useAgentResourceQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: agentResourceKeys.detail(params.id),
        queryFn: () => getClient()
            .agentResource.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchAgentResourceQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .agentResource.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchAgentResourceQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: agentResourceKeys.detail(params.id),
        queryFn: () => getClient()
            .agentResource.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
