diff --git a/imports/client-handler.tsx b/imports/client-handler.tsx index 9727cd47..abae6b97 100644 --- a/imports/client-handler.tsx +++ b/imports/client-handler.tsx @@ -1,11 +1,11 @@ import { DeepClient } from './client.js'; import { gql } from '@apollo/client/index.js'; -export async function evalClientHandler({ - value, - deep, - input = {}, -}: { +/** + * Evaluates a client handler + * @returns A promise that resolves to an object with either an error property that contains error or data property that contains result of the handler. + */ +export async function evalClientHandler(options: { value: string; deep: DeepClient; input?: any; @@ -13,6 +13,11 @@ export async function evalClientHandler({ error?: any; data?: any; }> { + const { + value, + deep, + input = {}, + } = options; try { console.log('evalClientHandler', 'value', value); // const evalResult = (new Function(`return ${value}`))();