# Payload in subscription

**URL:** <https://discuss.dgraph.io/t/payload-in-subscription/9127>\
**Category:** Issues\
**Created:** [July 31, 2020, 5:57am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127 "2020-07-31T05:57:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![yodaheis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yodaheis/32/4321_2.png) [@yodaheis](https://discuss.dgraph.io/u/yodaheis)\
**Post date:** [July 31, 2020, 5:57am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/1 "2020-07-31T05:57:57Z")

</div>

Why does subscription query return all the nodes in the result everytime a new node has been created? This increases the payload a lot.

Is there an efficient way to fetch only the data that has changed? Like only the add, update or deleted node?

---

<div class="post-metadata">

**Author:** ![gja](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/gja/32/2654_2.png) [@gja](https://discuss.dgraph.io/u/gja)\
**Post date:** [July 31, 2020, 8:08am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/2 "2020-07-31T08:08:59Z")

</div>

Hi @yodaheis,

Thanks for the question. Awesome to see you here in the community!

Currently, Dgraph only supports subscriptions that return the result of a query at regular intervals. Would you mind elaborating on what you are trying to build?

Tejas

---

<div class="post-metadata">

**Author:** ![yodaheis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yodaheis/32/4321_2.png) [@yodaheis](https://discuss.dgraph.io/u/yodaheis)\
**Post date:** [July 31, 2020, 12:03pm UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/3 "2020-07-31T12:03:05Z")

</div>

Hi Tejas,

Like even for a simple chat application, everytime a new message has been added, the subscription query will return all the messages, instead of the new message(s) added.  
What if I want to get messages sent after the last one I have received?  
I can think of a couple of ways to workaround this, by structuring the query with parameters, but there are many limitations around it, especially since there is no cursor as a filter parameter

---

<div class="post-metadata">

**Author:** ![timcash](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/timcash/32/4450_2.png) [@timcash](https://discuss.dgraph.io/u/timcash)\
**Post date:** [August 26, 2020, 8:38pm UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/4 "2020-08-26T20:38:04Z")

</div>

Same question, if the chat has thousands of messages would be nice to only get the deltas. Otherwise this will generate a ton of traffic as every new message will resend the entire data set correct?

---

<div class="post-metadata">

**Author:** ![abhijit-kar](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/abhijit-kar/32/3726_2.png) [@abhijit-kar](https://discuss.dgraph.io/u/abhijit-kar)\
**Post date:** [August 27, 2020, 6:32am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/6 "2020-08-27T06:32:54Z")

</div>

Hey @timcash & @yodaheis ,

It seems the solution is just a query with filter.

Refer to answer by @pawan :

> [@Using subscription for data processing](http://discuss.hypermode.com/t/using-subscription-for-data-processing/9696/3):
>
> 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 us…

---

<div class="post-metadata">

**Author:** ![yodaheis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yodaheis/32/4321_2.png) [@yodaheis](https://discuss.dgraph.io/u/yodaheis)\
**Post date:** [September 11, 2020, 7:42am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/7 "2020-09-11T07:42:15Z")

</div>

@abhijit-kar, filter in GraphQL is limited to indexes on scalar types only. and cannot use subscription on custom DQL

---

<div class="post-metadata">

**Author:** ![andreiborisov](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/andreiborisov/32/8268_2.png) [@andreiborisov](https://discuss.dgraph.io/u/andreiborisov)\
**Post date:** [June 12, 2022, 4:04pm UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/8 "2022-06-12T16:04:24Z")

</div>

Since CDC is now available, when can we expect delta updates for GraphQL subscriptions?

This is crucial for a whole class of applications.

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [June 13, 2022, 1:20am UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/9 "2022-06-13T01:20:54Z")

</div>

This will probably be a while out as the whole subscription functions would need rebuilt. And there a ton of other pressing matters such as security concerns and bug fixes

---

<div class="post-metadata">

**Author:** ![andreiborisov](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/andreiborisov/32/8268_2.png) [@andreiborisov](https://discuss.dgraph.io/u/andreiborisov)\
**Post date:** [June 21, 2022, 8:06pm UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/10 "2022-06-21T20:06:57Z")

</div>

Thanks for the update! Still, it’s nice to know it’s still in the pipeline somewhere🙌🏻

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [June 22, 2022, 7:03pm UTC](https://discuss.dgraph.io/t/payload-in-subscription/9127/11 "2022-06-22T19:03:58Z")

</div>

> [@andreiborisov](#):
>
> it’s nice to know it’s still in the pipeline somewhere

Oh, no I think you misunderstood me… there is NO pipeline right now. I was just saying to not expect this any time soon.
