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. 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;