Skip to content

Commit bc5e75b

Browse files
fix: result instead of returns (#671)
* fix: result instead of returns Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * πŸ“„ Update LLMs.txt snapshot for PR review --------- Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2bb4404 commit bc5e75b

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

β€Ž.llms-snapshots/llms-full.txtβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2876,7 +2876,7 @@ Defines a read-only function that returns data without modifying any state.
28762876
```
28772877

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

28822882
### Update
@@ -2891,7 +2891,7 @@ Defines a function that can read and write state.
28912891
```
28922892

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

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

72947294
```
7295-
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; }});
7295+
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; }});
72967296
```
72977297

72987298
Handlers can be synchronous or asynchronous. Both `args` and `returns` are optional.

β€Žblog/2026-03-16-custom-functions-in-typescript/index.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const ResultSchema = j.strictObject({
4747

4848
export const myUpdate = defineUpdate({
4949
args: ArgsSchema,
50-
returns: ResultSchema,
50+
result: ResultSchema,
5151
handler: async ({ name }) => {
5252
// your logic here
5353
return { message: `Saved ${name}.` };

β€Ždocs/build/functions/development/components/query.mdxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn my_function() -> String {
2323
```typescript
2424
export const myFunction = defineQuery({
2525
args: Schema,
26-
returns: Schema,
26+
result: Schema,
2727
handler: ({ args }) => {
2828
// Your logic here
2929
return args;

β€Ždocs/build/functions/development/components/update.mdxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn my_function() -> String {
2323
```typescript
2424
export const myFunction = defineUpdate({
2525
args: Schema,
26-
returns: Schema,
26+
result: Schema,
2727
handler: async ({ args }) => {
2828
// Your logic here
2929
return args;

β€Ždocs/guides/typescript.mdxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const Schema = j.strictObject({
162162

163163
export const helloWorld = defineUpdate({
164164
args: Schema,
165-
returns: Schema,
165+
result: Schema,
166166
handler: async ({ args }) => {
167167
// Your logic here
168168
return args;

0 commit comments

Comments
Β (0)