diff --git a/examples/stable/test/end_to_end/candid_rpc/init/package-lock.json b/examples/stable/test/end_to_end/candid_rpc/init/package-lock.json index 171a9d6e5e..cad66e3dba 100644 --- a/examples/stable/test/end_to_end/candid_rpc/init/package-lock.json +++ b/examples/stable/test/end_to_end/candid_rpc/init/package-lock.json @@ -12,6 +12,7 @@ } }, "../../../../../experimental/test/end_to_end/candid_rpc/init": { + "name": "init_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.24.1" diff --git a/src/lib/stable/canister_methods/index.ts b/src/lib/stable/canister_methods/index.ts index d2ed1564e4..e991c44033 100644 --- a/src/lib/stable/canister_methods/index.ts +++ b/src/lib/stable/canister_methods/index.ts @@ -17,7 +17,7 @@ export function decoratorArgumentsHandler( methodMetaKey: keyof MethodMeta, param1?: MethodType | IDL.Type[], param2?: ClassMethodDecoratorContext | IDL.Type, - param3?: { manual?: boolean } + param3?: { composite?: boolean; manual?: boolean } ): any { // First overload - decorator without params if (typeof param1 === 'function') { @@ -61,7 +61,7 @@ function decoratorImplementation( context: ClassMethodDecoratorContext, paramIdlTypes?: IDL.Type[], returnIdlType?: IDL.Type, - options?: { manual?: boolean } + options?: { composite?: boolean; manual?: boolean } ): MethodType { const name = context.name as string; @@ -70,10 +70,18 @@ function decoratorImplementation( if (canisterMethodMode !== 'heartbeat') { if (Array.isArray(globalThis._azleMethodMeta[methodMetaKey])) { - (globalThis._azleMethodMeta[methodMetaKey] as Method[]).push({ - name, - index - }); + if (canisterMethodMode === 'query') { + (globalThis._azleMethodMeta[methodMetaKey] as Method[]).push({ + name, + index, + composite: options?.composite ?? false + }); + } else { + (globalThis._azleMethodMeta[methodMetaKey] as Method[]).push({ + name, + index + }); + } } else { (globalThis._azleMethodMeta[methodMetaKey] as Method) = { name, diff --git a/src/lib/stable/canister_methods/query.ts b/src/lib/stable/canister_methods/query.ts index fe1200ec43..cfd767ad66 100644 --- a/src/lib/stable/canister_methods/query.ts +++ b/src/lib/stable/canister_methods/query.ts @@ -11,6 +11,7 @@ export function query( paramIdlTypes?: IDL.Type[], returnIdlType?: IDL.Type, options?: { + composite?: boolean; manual?: boolean; } ): (