Graphql-WS subscription always returning the whole data set instead of the the delta

Graphql-WS subscription always returning the whole data set instead of the the delta


0

I am using the graphql-ws library for subscribing to the following data:

export const x = gql`
    subscription x($user_id: uuid!, $contact: uuid!){
        chats(where: {
            user_id: {
                _eq: $user_id
            },
            contact: {
                _eq: $contact
            }}) {
            title
          }`

I subscribed as follows:

const subscription = client.subscribe({
    query: x,
    variables: {
      user_id: ...,
      contact: ...
    }
  }, {
    next(data) {
      console.log(data);
    },
    complete() {
      console.log('done');
    },
    error(e) {
      console.log(e);
    },
});

On changes I receive the whole data set but is it possible to get notified about certain events and only get the delta? If I delete a row for example it sends me the current state of the whole table containing all rows apart of the one that was deleted.

I read the corresponding documentation but could not find anything. Any help is appreciated.


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *