Skip to main content
API Reference / modelence / client / callMethod
callMethod<T>(methodName, args?, options?): Promise<T>
Defined in: packages/modelence/src/client/method.ts:103 Calls a server-side method (query or mutation) defined on a Modelence module. Both args and options are optional. Use the type parameter T to type the return value.

Example

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterTypeDescription
methodNamestringFully qualified method name, e.g. 'todo.getAll'.
args?MethodArgsArguments passed to the server-side method. Defaults to {}.
options?CallMethodOptionsCall-site options such as a custom CallMethodOptions.errorHandler. Defaults to {}.

Returns

Promise<T> A promise that resolves to the method’s return value.