Skip to content

Commit 6247bb9

Browse files
fix: custom functions args type (not destructed) (#739)
* fix: custom functions args type (not destructed) 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 7d78822 commit 6247bb9

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

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

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,7 @@ Defines a read-only function that returns data without modifying any state.
29372937
```
29382938

29392939
```
2940-
export const myFunction = defineQuery({ args: Schema, result: Schema, handler: ({ args }) => { // Your logic here return args; }});
2940+
export const myFunction = defineQuery({ args: Schema, result: Schema, handler: (args) => { // Your logic here return args; }});
29412941
```
29422942

29432943
### Update
@@ -2952,7 +2952,7 @@ Defines a function that can read and write state.
29522952
```
29532953

29542954
```
2955-
export const myFunction = defineUpdate({ args: Schema, result: Schema, handler: async ({ args }) => { // Your logic here return args; }});
2955+
export const myFunction = defineUpdate({ args: Schema, result: Schema, handler: async (args) => { // Your logic here return args; }});
29562956
```
29572957

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

75167516
```
7517-
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; }});
7517+
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; }});
75187518
```
75197519

75207520
Handlers can be synchronous or asynchronous. Both `args` and `returns` are optional.
@@ -10410,36 +10410,36 @@ For most applications, we recommend using the default subnets and staying on the
1041010410

1041110411
| Subnet ID | Type | Canisters (Running/Stopped) | Nodes (Up/Total) |
1041210412
| --- | --- | --- | --- |
10413-
| 6pbhf-qzpdk-kuqbr-pklfa-5ehhf-jfjps-zsj6q-57nrl-kzhpd-mu7hc-vae | Juno's Subnet | 36246/707 | 13/13 |
10414-
| pzp6e-ekpqk-3c5x7-2h6so-njoeq-mt45d-h3h6c-q3mxf-vpeq5-fk5o7-yae | Fiduciary | 3839/51 | 34/34 |
10415-
| bkfrj-6k62g-dycql-7h53p-atvkj-zg4to-gaogh-netha-ptybj-ntsgw-rqe | European | 25203/720 | 13/13 |
10416-
| brlsh-zidhj-3yy3e-6vqbz-7xnih-xeq2l-as5oc-g32c4-i5pdn-2wwof-oae | | 41102/3393 | 13/13 |
10417-
| o3ow2-2ipam-6fcjo-3j5vt-fzbge-2g7my-5fz2m-p4o2t-dwlc4-gt2q7-5ae | | 63277/2922 | 13/13 |
10418-
| 4ecnw-byqwz-dtgss-ua2mh-pfvs7-c3lct-gtf4e-hnu75-j7eek-iifqm-sqe | | 14500/2948 | 13/13 |
10419-
| opn46-zyspe-hhmyp-4zu6u-7sbrh-dok77-m7dch-im62f-vyimr-a3n2c-4ae | | 46286/3512 | 12/13 |
10420-
| nl6hn-ja4yw-wvmpy-3z2jx-ymc34-pisx3-3cp5z-3oj4a-qzzny-jbsv3-4qe | | 37617/3503 | 13/13 |
10421-
| io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe | | 8698/4391 | 13/13 |
10422-
| ejbmu-grnam-gk6ol-6irwa-htwoj-7ihfl-goimw-hlnvh-abms4-47v2e-zqe | | 17317/2708 | 13/13 |
10423-
| gmq5v-hbozq-uui6y-o55wc-ihop3-562wb-3qspg-nnijg-npqp5-he3cj-3ae | | 40142/2848 | 13/13 |
10424-
| pjljw-kztyl-46ud4-ofrj6-nzkhm-3n4nt-wi3jt-ypmav-ijqkt-gjf66-uae | | 38484/2874 | 13/13 |
10425-
| 4zbus-z2bmt-ilreg-xakz4-6tyre-hsqj4-slb4g-zjwqo-snjcc-iqphi-3qe | | 72117/2781 | 13/13 |
10426-
| 5kdm2-62fc6-fwnja-hutkz-ycsnm-4z33i-woh43-4cenu-ev7mi-gii6t-4ae | | 19030/2713 | 13/13 |
10427-
| e66qm-3cydn-nkf4i-ml4rb-4ro6o-srm5s-x5hwq-hnprz-3meqp-s7vks-5qe | | 41524/3469 | 13/13 |
10428-
| qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe | | 59176/2707 | 13/13 |
10429-
| snjp4-xlbw4-mnbog-ddwy6-6ckfd-2w5a2-eipqo-7l436-pxqkh-l6fuv-vae | | 10278/3607 | 13/13 |
10430-
| shefu-t3kr5-t5q3w-mqmdq-jabyv-vyvtf-cyyey-3kmo4-toyln-emubw-4qe | | 8764/4473 | 12/13 |
10431-
| csyj4-zmann-ys6ge-3kzi6-onexi-obayx-2fvak-zersm-euci4-6pslt-lae | | 9403/3803 | 13/13 |
10432-
| yinp6-35cfo-wgcd2-oc4ty-2kqpf-t4dul-rfk33-fsq3r-mfmua-m2ngh-jqe | | 14269/2992 | 13/13 |
10433-
| w4asl-4nmyj-qnr7c-6cqq4-tkwmt-o26di-iupkq-vx4kt-asbrx-jzuxh-4ae | | 8763/4557 | 13/13 |
10434-
| c4isl-65rwf-emhk5-5ta5m-ngl73-rgrl3-tcc56-2hkja-4erqd-iivmy-7ae | | 7323/6086 | 13/13 |
10435-
| mpubz-g52jc-grhjo-5oze5-qcj74-sex34-omprz-ivnsm-qvvhr-rfzpv-vae | | 61751/2956 | 13/13 |
10436-
| fuqsr-in2lc-zbcjj-ydmcw-pzq7h-4xm2z-pto4i-dcyee-5z4rz-x63ji-nae | | 29196/2758 | 13/13 |
10437-
| cv73p-6v7zi-u67oy-7jc3h-qspsz-g5lrj-4fn7k-xrax3-thek2-sl46v-jae | | 57482/2814 | 13/13 |
10438-
| pae4o-o6dxf-xki7q-ezclx-znyd6-fnk6w-vkv5z-5lfwh-xym2i-otrrw-fqe | | 10743/3209 | 13/13 |
10439-
| qxesv-zoxpm-vc64m-zxguk-5sj74-35vrb-tbgwg-pcird-5gr26-62oxl-cae | | 8232/5103 | 13/13 |
10440-
| 4utr6-xo2fz-v7fsb-t3wsg-k7sfl-cj2ba-ghdnd-kcrfo-xavdb-ebean-mqe | | 8127/5162 | 13/13 |
10441-
| lspz2-jx4pu-k3e7p-znm7j-q4yum-ork6e-6w4q6-pijwq-znehu-4jabe-kqe | | 45976/3643 | 13/13 |
10442-
| jtdsg-3h6gi-hs7o5-z2soi-43w3z-soyl3-ajnp3-ekni5-sw553-5kw67-nqe | | 33498/2811 | 13/13 |
10413+
| 6pbhf-qzpdk-kuqbr-pklfa-5ehhf-jfjps-zsj6q-57nrl-kzhpd-mu7hc-vae | Juno's Subnet | 36249/711 | 13/13 |
10414+
| pzp6e-ekpqk-3c5x7-2h6so-njoeq-mt45d-h3h6c-q3mxf-vpeq5-fk5o7-yae | Fiduciary | 3894/52 | 34/34 |
10415+
| bkfrj-6k62g-dycql-7h53p-atvkj-zg4to-gaogh-netha-ptybj-ntsgw-rqe | European | 25222/723 | 13/13 |
10416+
| brlsh-zidhj-3yy3e-6vqbz-7xnih-xeq2l-as5oc-g32c4-i5pdn-2wwof-oae | | 41139/3588 | 13/13 |
10417+
| o3ow2-2ipam-6fcjo-3j5vt-fzbge-2g7my-5fz2m-p4o2t-dwlc4-gt2q7-5ae | | 63351/3107 | 13/13 |
10418+
| 4ecnw-byqwz-dtgss-ua2mh-pfvs7-c3lct-gtf4e-hnu75-j7eek-iifqm-sqe | | 14614/3106 | 13/13 |
10419+
| opn46-zyspe-hhmyp-4zu6u-7sbrh-dok77-m7dch-im62f-vyimr-a3n2c-4ae | | 46384/3699 | 13/13 |
10420+
| nl6hn-ja4yw-wvmpy-3z2jx-ymc34-pisx3-3cp5z-3oj4a-qzzny-jbsv3-4qe | | 37746/3628 | 13/13 |
10421+
| io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe | | 8754/4531 | 13/13 |
10422+
| ejbmu-grnam-gk6ol-6irwa-htwoj-7ihfl-goimw-hlnvh-abms4-47v2e-zqe | | 17195/2883 | 13/13 |
10423+
| gmq5v-hbozq-uui6y-o55wc-ihop3-562wb-3qspg-nnijg-npqp5-he3cj-3ae | | 40148/3044 | 13/13 |
10424+
| pjljw-kztyl-46ud4-ofrj6-nzkhm-3n4nt-wi3jt-ypmav-ijqkt-gjf66-uae | | 38609/3054 | 13/13 |
10425+
| 4zbus-z2bmt-ilreg-xakz4-6tyre-hsqj4-slb4g-zjwqo-snjcc-iqphi-3qe | | 72518/2942 | 13/13 |
10426+
| 5kdm2-62fc6-fwnja-hutkz-ycsnm-4z33i-woh43-4cenu-ev7mi-gii6t-4ae | | 19175/2854 | 13/13 |
10427+
| e66qm-3cydn-nkf4i-ml4rb-4ro6o-srm5s-x5hwq-hnprz-3meqp-s7vks-5qe | | 41628/3633 | 13/13 |
10428+
| qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe | | 59268/2853 | 13/13 |
10429+
| snjp4-xlbw4-mnbog-ddwy6-6ckfd-2w5a2-eipqo-7l436-pxqkh-l6fuv-vae | | 10360/3808 | 13/13 |
10430+
| shefu-t3kr5-t5q3w-mqmdq-jabyv-vyvtf-cyyey-3kmo4-toyln-emubw-4qe | | 8875/4637 | 12/13 |
10431+
| csyj4-zmann-ys6ge-3kzi6-onexi-obayx-2fvak-zersm-euci4-6pslt-lae | | 9550/3915 | 13/13 |
10432+
| yinp6-35cfo-wgcd2-oc4ty-2kqpf-t4dul-rfk33-fsq3r-mfmua-m2ngh-jqe | | 14505/3141 | 13/13 |
10433+
| w4asl-4nmyj-qnr7c-6cqq4-tkwmt-o26di-iupkq-vx4kt-asbrx-jzuxh-4ae | | 9192/4722 | 13/13 |
10434+
| c4isl-65rwf-emhk5-5ta5m-ngl73-rgrl3-tcc56-2hkja-4erqd-iivmy-7ae | | 7383/6292 | 13/13 |
10435+
| mpubz-g52jc-grhjo-5oze5-qcj74-sex34-omprz-ivnsm-qvvhr-rfzpv-vae | | 61822/3140 | 13/13 |
10436+
| fuqsr-in2lc-zbcjj-ydmcw-pzq7h-4xm2z-pto4i-dcyee-5z4rz-x63ji-nae | | 29448/2899 | 13/13 |
10437+
| cv73p-6v7zi-u67oy-7jc3h-qspsz-g5lrj-4fn7k-xrax3-thek2-sl46v-jae | | 57581/2972 | 13/13 |
10438+
| pae4o-o6dxf-xki7q-ezclx-znyd6-fnk6w-vkv5z-5lfwh-xym2i-otrrw-fqe | | 10832/3366 | 13/13 |
10439+
| qxesv-zoxpm-vc64m-zxguk-5sj74-35vrb-tbgwg-pcird-5gr26-62oxl-cae | | 8258/5313 | 13/13 |
10440+
| 4utr6-xo2fz-v7fsb-t3wsg-k7sfl-cj2ba-ghdnd-kcrfo-xavdb-ebean-mqe | | 8189/5356 | 13/13 |
10441+
| lspz2-jx4pu-k3e7p-znm7j-q4yum-ork6e-6w4q6-pijwq-znehu-4jabe-kqe | | 46067/3828 | 13/13 |
10442+
| jtdsg-3h6gi-hs7o5-z2soi-43w3z-soyl3-ajnp3-ekni5-sw553-5kw67-nqe | | 33601/2977 | 13/13 |
1044310443

1044410444
---
1044510445

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Schema = j.discriminatedUnion("type", [
111111

112112
export const registerPet = defineUpdate({
113113
args: Schema,
114-
handler: ({ args }) => {
114+
handler: (args) => {
115115
if (args.type === "cat") {
116116
// handle cat
117117
} else {

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

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

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const Schema = j.strictObject({
161161
export const helloWorld = defineUpdate({
162162
args: Schema,
163163
result: Schema,
164-
handler: async ({ args }) => {
164+
handler: async (args) => {
165165
// Your logic here
166166
return args;
167167
}

0 commit comments

Comments
Β (0)