When I setup a function that gets called by a document.create does this function intercept the creation of the document and I have to create it myself with the given payload or how does that work?
nope, function doesn't intercept, function get trigger once doc successfully get created...
yap, if you want to prevent user from creating Doc directly, you can use the function where user pass the Data
Thatβs bad π It would be soooo easy
Yeah thatβs exactly what I donβt want to do haha
I mean, yaa but as Function act as Serverless so in that sense it's not possible...
Yeah makes sense π«
can understand but, for security is concern so that's ideal approach
Oke thx ππ» Have a nice day!
no prob you too π
Oh another quick question π Do you think itβs faster to make standalone functions for stuff I need to check on every execution or should I just paste this code in every function?
Hope you understand what I mean
it's generally idea to have seperate function, not just that it will faster ( I mean relative faster not compareabily) , but also another reason to have smaller function is to seperate area of concern
so, if one function have bug another function still will work and user don't have to wait for issue for that function to be fixed
True
Will the functions automatically get called locally? Or can I force this somehow?
it have both behaviour, it can be called manually via SDK or automatically trigger whenever new action happen such as document creation, new user regsitation etc...
it's upto you how you would like func to work
I mean if I trigger func 1 from my client and then func 2 gets triggered from inside func 1. Does func 2 gets automatically called locally?
oh yaap
one function can call another function internally*
Okay and this happens automatically? So it does not do the round trip over the external api endpoint?
yap it happen internally, round trip nope it doesn't
ππ»
Recommended threads
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...
- Error | general_unknown
I have built a website using Appwrite Cloud as backend, and also using sites for deployment. My website is live but sometimes it shows Appwrite's Error general_...
- functions domain error
I cannot set up the domain for function Iβm trying to add the domain api.example.com I can only use Cloudflare as the DNS provider because my domain provider do...