Using subscription for data processing

Welcome to the Dgraph community @iyinoluwaayoola

Subscriptions in Dgraph would return all the data for the query that you are subscribed to.

This could be done via a filter operation, say you had a created_at and a updated_at field which is part of your Todo, then you could filter the TODOs created at after a certain timestamp. This would make sure that you only get the nodes created in the last interval. For this to work, you would have to re-subscribe by updating the filter condition and using the latest timestamp.

Not sure I get this, could you clarify how you plan to use this? A subscription query would return the results which are valid at the point a query is done. If you wanted the results before a mutation, then the query has to be done before.

This would be possible if your subscription query filter had a filter on created_at or updated_at and such.

It’s not possible currently to subscribe directly to events of nodes being added/updated/deleted. We’ll look into adding that in the future.

Could you share more details of what you are looking for here with an example? Do you mean for e.g. when the title of any Todo changes?

1 Like