I studied the architecture of
gatsy-source-plone (GSP) and of
gatsby-source-filesystem (GSP) plugins.
What GSF does is it uses
chokidar which is a file watcher to watch for events and then when those events are triggered, update Gatsby source nodes.
To have similar functionality in GSP we would need to have a method to send data from Plone to the plugin without an explicit request. This method will be used to send info about changes made to Plone to GSP where we can use the gatsby api to update source nodes., much like the way GSF does it.
Since this kind of communication is not possible with REST APIs, we would need to a websocket based approach to communicate with Plone.
I have not investigated the abilities of
Guillotina, but I think we should use that instead of the REST API.
Ofcourse we would need to add methods that actually send data from Plone/Guillotina to GSP on particular events (like chokidar does with files), but these can also be used for other usecases such as the one in this thread I found
All of the above points are after just a surface level inspection.
So let me know if I am thinking in the right direction or if there is a error in my understandings/assumptions.