From 2b1fb48a3858798f714fa106ff5d4acfba9be1ae Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 16 Mar 2026 12:06:56 +0100 Subject: [PATCH 1/2] fix: result instead of returns Signed-off-by: David Dal Busco --- blog/2026-03-16-custom-functions-in-typescript/index.md | 2 +- docs/build/functions/development/components/query.mdx | 2 +- docs/build/functions/development/components/update.mdx | 2 +- docs/guides/typescript.mdx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blog/2026-03-16-custom-functions-in-typescript/index.md b/blog/2026-03-16-custom-functions-in-typescript/index.md index 03040642..6fe0b524 100644 --- a/blog/2026-03-16-custom-functions-in-typescript/index.md +++ b/blog/2026-03-16-custom-functions-in-typescript/index.md @@ -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}.` }; diff --git a/docs/build/functions/development/components/query.mdx b/docs/build/functions/development/components/query.mdx index 818a07a3..7387a52b 100644 --- a/docs/build/functions/development/components/query.mdx +++ b/docs/build/functions/development/components/query.mdx @@ -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; diff --git a/docs/build/functions/development/components/update.mdx b/docs/build/functions/development/components/update.mdx index f2b7849e..3c6c5d02 100644 --- a/docs/build/functions/development/components/update.mdx +++ b/docs/build/functions/development/components/update.mdx @@ -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; diff --git a/docs/guides/typescript.mdx b/docs/guides/typescript.mdx index 00abf680..b93220c2 100644 --- a/docs/guides/typescript.mdx +++ b/docs/guides/typescript.mdx @@ -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; From f3588d8a193a761e4ca812258534f27cb0f8295f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:08:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 739f2dfe..14da97c1 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -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 @@ -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; }}); ``` --- @@ -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.