Join the Webstudio community

Updated 2 weeks ago

How to pass data from one GraphQL request to another in Webstudio?

Hi Webstudio team,

On my dynamic “Review” page I can grab the page slug via system.params.slug.

My backend requires two steps:

Use that slug (plus ratingId and language) to fetch the numeric ID of the post.

Use the returned ID to run the standard GraphQL request that delivers the full review data.

What is the recommended way in Webstudio to:

Trigger the first request on page load (or when the slug changes);

Feed the single value it returns straight into the $id variable of the second request;

Ensure the second request waits until the first one finishes, without writing custom JavaScript?

A brief step-by-step or a link to the relevant doc section would be perfect.

Thank you!
B
1 comment
Doing waterfall of requests can greatly affect performance so it's not allowed to create sequence of resources. Your graphql api should expose filtering by slug. This is kinda the point of graphql to avoid multiple requests.
Add a reply
Sign up and join the conversation on Discord