Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2876,7 +2876,7 @@ Defines a read-only function that returns data without modifying any state.
```

```
export const myFunction = defineQuery({ args: Schema, returns: Schema, handler: ({ args }) => { // Your logic here return args; }});
export const myFunction = defineQuery({ args: Schema, result: Schema, handler: ({ args }) => { // Your logic here return args; }});
```

### Update
Expand All @@ -2891,7 +2891,7 @@ Defines a function that can read and write state.
```

```
export const myFunction = defineUpdate({ args: Schema, returns: Schema, handler: async ({ args }) => { // Your logic here return args; }});
export const myFunction = defineUpdate({ args: Schema, result: Schema, handler: async ({ args }) => { // Your logic here return args; }});
```

---
Expand Down Expand Up @@ -7292,7 +7292,7 @@ An **update** is a function that can read and write state. Use it when your logi
Describe your function's input and output shapes using the `j` type system, then pass them to `defineQuery` or `defineUpdate` along with your handler:

```
import { defineUpdate } from "@junobuild/functions";import { j } from "@junobuild/schema";const Schema = j.strictObject({ name: j.string(), id: j.principal()});export const helloWorld = defineUpdate({ args: Schema, returns: Schema, handler: async ({ args }) => { // Your logic here return args; }});
import { defineUpdate } from "@junobuild/functions";import { j } from "@junobuild/schema";const Schema = j.strictObject({ name: j.string(), id: j.principal()});export const helloWorld = defineUpdate({ args: Schema, result: Schema, handler: async ({ args }) => { // Your logic here return args; }});
```

Handlers can be synchronous or asynchronous. Both `args` and `returns` are optional.
Expand Down
2 changes: 1 addition & 1 deletion blog/2026-03-16-custom-functions-in-typescript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ResultSchema = j.strictObject({

export const myUpdate = defineUpdate({
args: ArgsSchema,
returns: ResultSchema,
result: ResultSchema,
handler: async ({ name }) => {
// your logic here
return { message: `Saved ${name}.` };
Expand Down
2 changes: 1 addition & 1 deletion docs/build/functions/development/components/query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn my_function() -> String {
```typescript
export const myFunction = defineQuery({
args: Schema,
returns: Schema,
result: Schema,
handler: ({ args }) => {
// Your logic here
return args;
Expand Down
2 changes: 1 addition & 1 deletion docs/build/functions/development/components/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn my_function() -> String {
```typescript
export const myFunction = defineUpdate({
args: Schema,
returns: Schema,
result: Schema,
handler: async ({ args }) => {
// Your logic here
return args;
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const Schema = j.strictObject({

export const helloWorld = defineUpdate({
args: Schema,
returns: Schema,
result: Schema,
handler: async ({ args }) => {
// Your logic here
return args;
Expand Down