Join the Webstudio community

Updated yesterday

Nesting resource calls

Hey! New here, this looks amazing! Looking forward to playing around with it some more. Right now I'm trying to integrate Fibery into webstudio. Specifically the files field. It needs two calls, one to get the secret, then another per item to get the files. Is it possible to run a call per collection item that references the secret returned within that collection item?
J
S
14 comments
Hey no you can't chain together API calls. You can make multiple async but not have one depend on another.

If that's the case, its kind of an unfortunate pattern. Not great for perf or api usage. No way to to pass in some param to the first call to resolve files?
Yeah i think thats tha case...
Yeah.. not ideal :(((
AI answer. Might be worth a shot πŸ€·β€β™‚οΈ
Attachment
Screenshot_2025-04-05_at_3.53.42_PM.png
Hm, it seems that his url works, but it just redurects it to another place where the real file is. So i'd need to do the dynamic api call per collection item
Maybe fibery will improve this as some point...
Is this an existing feature request i could vote for? How do things work around here?
Ah that sounds really close.

As for voting we have all known issues here https://github.com/webstudio-is/webstudio/issues

I don't think we have one for letting resources depend on eachother as I don't think we've confirmed this is something we want to support. Often times there are ways to achieve it in one call... maybe this is an exception but I hope there is still some way
Okay makes sense.

Other use cases could be if you're using different backends for different things.

Example: getting a list of cities from one backend, and then showing different data per city. (Population, weather, etc) might have a different api for each.
But maybe im missing something.
Is the intetion to make your own api endpoint that will query all of these and return one? Then use that one in webstudio?
Yeah I mean its a hypothetical but I'm sure use cases exist. Generally the answer is yes, create some API to handle this which means you can also introduce error handling and caching policies
Okay sounds good I'll give it a shot
Add a reply
Sign up and join the conversation on Discord