because that would re-run the whole function. So, what’s the best practice handling that? Immediately returning the 300 uid’s, and then the client can just fetch these 300 posts through get queries? or is there a better solution?
That’s probably close to the best solution. You could store those 300 uids in redis, or similar, and then make another request to get all of the data from Dgraph for a subset of those 300 (say the top 10, or whatever you’d show the user on first page). When the user reaches the end, they send a request for the next page, and you’d just get that subset of uids from redis and ask Dgraph for all of the data about those specific nodes.