# Dgraph manual reverse index is gone after each GraphQL Schema upload

**URL:** <https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829>\
**Category:** GraphQL\
**Tags:** graphql, dgraph, kind:enhancement\
**Created:** [July 5, 2021, 9:28am UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829 "2021-07-05T09:28:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pshaddel](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pshaddel/32/11584_2.png) [@pshaddel](https://discuss.dgraph.io/u/pshaddel)\
**Post date:** [July 5, 2021, 9:28am UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/1 "2021-07-05T09:28:48Z")

</div>

We are using a GraphQL Schema and for some special cases we need reverse index to execute some custom queries but I couldn’t find a way to put this inside the GraphQL Schema and after each GraphQL Schema upload I must add this reverse index to schema manually. Is there a way to tell dgraph that a field has reverse index(I’m not talking about `hasInverse`):  
In this example I want to have a reverse index on `Movie.tags` predicate.

```auto
type Movie {
  id: ID!
  name: String!
  tags: [Tag] # need something here
}
type Tag {
  TagID: ID!
  nameL: String!
}

```

---

<div class="post-metadata">

**Author:** ![pshaddel](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pshaddel/32/11584_2.png) [@pshaddel](https://discuss.dgraph.io/u/pshaddel)\
**Post date:** [December 12, 2021, 12:04pm UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/2 "2021-12-12T12:04:43Z")

</div>

Anyone has any idea about this issue and how I can resolve it?

---

<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:** [December 12, 2021, 1:33pm UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/3 "2021-12-12T13:33:23Z")

</div>

This seems like a simple enough feature request. The OP is not asking for the reverse functionality in the GraphQL query API, just a directive that when applied in the GraphQL schema adds the reverse directive in the underlying DQL schema.

[@graphql](https://discuss.dgraph.io/groups/graphql) [@core-devs](https://discuss.dgraph.io/groups/core-devs)

---

<div class="post-metadata">

**Author:** ![RJKeevil](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rjkeevil/32/2625_2.png) [@RJKeevil](https://discuss.dgraph.io/u/RJKeevil)\
**Post date:** [December 16, 2021, 8:40am UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/4 "2021-12-16T08:40:12Z")

</div>

@pshaddel we also experienced this issue (and related problems such as count indexes also disappearing). A (bad) workaround is to also update your dql schema after each gql update. We generate our schemas from a yaml config file so the two are always in sync. But yes it would be nicer for this to be fixed in the product instead in future.

---

<div class="post-metadata">

**Author:** ![pshaddel](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/pshaddel/32/11584_2.png) [@pshaddel](https://discuss.dgraph.io/u/pshaddel)\
**Post date:** [December 16, 2021, 9:26am UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/5 "2021-12-16T09:26:19Z")

</div>

@RJKeevil  
Thank you for your response.  
I just took a look at this: [https://dgraph.io/docs/deploy/config/#yaml-config-file](https://dgraph.io/docs/deploy/config/#yaml-config-file) but couldn’t find anything about schema.  
Could you please specify in more details what steps should I take to accomplish something like your setup?

---

<div class="post-metadata">

**Author:** ![RJKeevil](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/rjkeevil/32/2625_2.png) [@RJKeevil](https://discuss.dgraph.io/u/RJKeevil)\
**Post date:** [December 16, 2021, 10:26am UTC](https://discuss.dgraph.io/t/dgraph-manual-reverse-index-is-gone-after-each-graphql-schema-upload/14829/6 "2021-12-16T10:26:34Z")

</div>

I’m afraid that it is custom Go code in my company’s application. We have some types (Go structs) that we use to generate matching graphQL and DQL schemas as part of a setup script. Its not something I can share unfortunately.
