diff --git a/src/ic-cdk-macros/CHANGELOG.md b/src/ic-cdk-macros/CHANGELOG.md index b9cafea9c..79a292309 100644 --- a/src/ic-cdk-macros/CHANGELOG.md +++ b/src/ic-cdk-macros/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +### Fixed + +- Export composite_query to Candid. (#419) + ## [0.7.1] - 2023-07-27 ### Fixed diff --git a/src/ic-cdk-macros/src/export.rs b/src/ic-cdk-macros/src/export.rs index a410d62e5..7ad6c645d 100644 --- a/src/ic-cdk-macros/src/export.rs +++ b/src/ic-cdk-macros/src/export.rs @@ -200,9 +200,10 @@ fn dfn_macro( #[cfg(feature = "export_candid")] let candid_method_attr = match method { - MethodType::Query => { - quote! { #[::candid::candid_method(query, rename = #function_name)] } + MethodType::Query if attrs.composite => { + quote! { #[::candid::candid_method(composite_query, rename = #function_name)] } } + MethodType::Query => quote! { #[::candid::candid_method(query, rename = #function_name)] }, MethodType::Update => { quote! { #[::candid::candid_method(update, rename = #function_name)] } }