Back

[SOLVED] any TypeScript support for Function's `context` object?

  • 0
  • Functions
manazo
22 Sep, 2023, 04:12

the doc says the context param of server Functions contains 4 elements. req, res, log, and error. but we don't know what's available for us inside these 4 element objects. I tried logging the whole object, but seems the Appwrite console doesn't dump objects, even if we pass it as JSON.stringify(<OBJECT>). it only shows string-based values.

So is there any way for me to check the whole object(s)?

TL;DR
User is asking if there is TypeScript support for the Function's `context` object in Appwrite. They have tried logging the object using `JSON.stringify` but it only shows string-based values. They want to know if there is a way to check the whole object(s). Solution: The user can refer to the documentation provided by Appwrite for information on the `context` object: <https://appwrite.io/docs/functions-develop#request>.
Drake
22 Sep, 2023, 04:35

They're mostly strings and objects...I'm surprised logging it or stringifying it doesn't work 🧐

Drake
22 Sep, 2023, 04:36

Res has functions and log and error are functions so you can't log those

Drake
22 Sep, 2023, 04:37

You do know we documented all of it, right?

https://appwrite.io/docs/functions-develop#request

manazo
22 Sep, 2023, 14:58

yes I checked those. I'm mainly asking about the TS support for better DX

Drake
22 Sep, 2023, 15:00

Ya we've talked about it internally multiple times. I think it's a matter of the time to do it, considering we have a dozen or so runtimes

manazo
22 Sep, 2023, 15:07

think i can make any contribution to this?

Drake
22 Sep, 2023, 17:53

it would be best to start with an issue

manazo
22 Sep, 2023, 18:37

[SOLVED] any TypeScript support for Function's context object?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more