Join the Webstudio community

Updated 4 days ago

Best practice for GraphQL data fetching in root vs page-level queries

In Webstudio, is it a good practice to include full GraphQL queries (with rich content like long ACF text fields) in root-level data fetches? Or would it be more optimal to only fetch essential metadata (like IDs, slugs, and short titles) in the root, and then fetch full content (e.g. description, content, conclusion) on page-level only when needed? I’m concerned about performance when the same root query runs across many pages.
Attachment
image.png
D
B
2 comments
In short: I understand that if I add a query to root, it will be done on all templates?
Yes, at the moment. In the future we will improve usage detection.
Add a reply
Sign up and join the conversation on Discord