Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 573 Bytes

File metadata and controls

37 lines (31 loc) · 573 Bytes

Defines a read-only function that returns data without modifying any state.

import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem";

<Tabs groupId="functions">
<TabItem value="Rust">
#[ic_cdk::query]
fn my_function() -> String {
    // Your logic here
}
</TabItem>
<TabItem value="TypeScript">
export const myFunction = defineQuery({
  args: Schema,
  result: Schema,
  handler: (args) => {
    // Your logic here
    return args;
  }
});
</TabItem>
</Tabs>