For now, I’ve been playing with the Frontity framework to create a series of tutorials for continuing my Headless WordPress category.
What I wanted to achieve is to get comments on a post. And I struggled to find a good way to update the state and add custom data to the source. I could get it following the state and such but I would like to see a more API-like approach.
I’ve tried using the .populate() method but that, if I understand correctly, works per “URL”. So what I could do is fill a custom object “comments” inside of state and relate it to a post ID.
What could be more useful would be to use a method such as populate to add additional data only to that one data object we get from source.
Maybe there is one but I’ve missed it. If there is nothing like that, I would like something like that inside of the v2