Skip to content

Commit 828e03b

Browse files
Merge pull request #307 from deep-foundation/documentation/add_client_handler_doc
Documentation/add client handler doc
2 parents 427e406 + 0a97d69 commit 828e03b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

imports/client-handler.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import { DeepClient } from './client.js';
22
import { gql } from '@apollo/client/index.js';
33

4-
export async function evalClientHandler({
5-
value,
6-
deep,
7-
input = {},
8-
}: {
4+
/**
5+
* Evaluates a client handler
6+
* @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.
7+
*/
8+
export async function evalClientHandler(options: {
99
value: string;
1010
deep: DeepClient;
1111
input?: any;
1212
}): Promise<{
1313
error?: any;
1414
data?: any;
1515
}> {
16+
const {
17+
value,
18+
deep,
19+
input = {},
20+
} = options;
1621
try {
1722
console.log('evalClientHandler', 'value', value);
1823
// const evalResult = (new Function(`return ${value}`))();

0 commit comments

Comments
 (0)