/**
 * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions via function_definition_id FK, with task_identifier as the denormalized routing/audit slug.
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildListSelectionArgs } from '../selection';
import { functionInvocationKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const functionInvocationsQueryKey = functionInvocationKeys.list;
export function useFunctionInvocationsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: functionInvocationKeys.list(args),
        queryFn: () => getClient().functionInvocation.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchFunctionInvocationsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().functionInvocation.findMany(args).unwrap();
}
export async function prefetchFunctionInvocationsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: functionInvocationKeys.list(args),
        queryFn: () => getClient().functionInvocation.findMany(args).unwrap(),
    });
}
