# How backend to subscribe something changed

**URL:** <https://discuss.dgraph.io/t/how-backend-to-subscribe-something-changed/9148>\
**Category:** Users\
**Tags:** mutation, dgraph, untagged\
**Created:** [August 1, 2020, 9:17am UTC](https://discuss.dgraph.io/t/how-backend-to-subscribe-something-changed/9148 "2020-08-01T09:17:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaisawind](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kaisawind/32/4224_2.png) [@kaisawind](https://discuss.dgraph.io/u/kaisawind)\
**Post date:** [August 1, 2020, 9:17am UTC](https://discuss.dgraph.io/t/how-backend-to-subscribe-something-changed/9148/1 "2020-08-01T09:17:27Z")

</div>

Dgraph is good for frontend, it’s also easy for backend to use with `dgo`.  
But how to do when frontend and backend both to do something?

For example:  
Frontend will create a product, and the backend will create a microservice for this product to commuticate with other services.  
If we use RESTful API, we have an api `CreateProduct` or `Product` with `POST` method, it’s easy to know which product is created, and what is it.  
But when we use dgraph, we just have an api with `Request` param, we don’t know what object is it.

How can we do for that?

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [August 1, 2020, 12:12pm UTC](https://discuss.dgraph.io/t/how-backend-to-subscribe-something-changed/9148/2 "2020-08-01T12:12:56Z")

</div>

Hi @kaisawind  
Please have a look at the introspection capabilities to get an idea of what type of queries and mutations are serviced by a particular graphql endpoint. This is similar to [HAL browser](https://spring.io/projects/spring-data-rest) that a spring data application ships and provides metadata of service capabilities.  
For example, in Dgraph, if you fire the following query from a graphql client (like altair) you will see the list of supported operations and other information.

```auto
  {
  __schema {
  __typename
  mutationType{
    name
    kind
    fields{
      name
    }
  }
  }
  }

```

Dgraph creates add, update and delete mutation with for each Dgraph schema type. Similarly, to get the list of queries/gets supported, please use the following query.

```auto
 {
  __schema {
  __typename
  queryType{
    name
    kind
    fields{
      name
    }
  }
  }
  }

```

The title of your post talks about listening to change. I am not sure I understand the question correctly, but perhaps [this](https://dgraph.io/blog/post/how-does-graphql-subscription/) blog on Graphql subscription published recently might help. It talks about how a front-end is notified by Dgraph when changes occur.

From a Dgraph perspective, the following query provides the schema. This can be fired from Ratel.

```auto
schema {
  type
  index
  reverse
  tokenizer
  list
  count
  upsert
  lang
}

```

---

<div class="post-metadata">

**Author:** ![kaisawind](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/kaisawind/32/4224_2.png) [@kaisawind](https://discuss.dgraph.io/u/kaisawind)\
**Post date:** [August 1, 2020, 12:19pm UTC](https://discuss.dgraph.io/t/how-backend-to-subscribe-something-changed/9148/3 "2020-08-01T12:19:40Z")

</div>

yes, it’s subscription. Subscription is released at v200.07.  
Thank you.
