# Mutation Documentation Does Not Adequately Cover Ref Types

**URL:** https://discuss.dgraph.io/t/mutation-documentation-does-not-adequately-cover-ref-types/14900
**Category:** GraphQL
**Tags:** kind:question
**Created:** [July 9, 2021, 5:46pm UTC](https://discuss.dgraph.io/t/mutation-documentation-does-not-adequately-cover-ref-types/14900 "2021-07-09T17:46:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ben\_Holland](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ben_holland/32/8564_2.png) [@Ben\_Holland](https://discuss.dgraph.io/u/Ben_Holland)
#### Post date: [July 9, 2021, 5:46pm UTC](https://discuss.dgraph.io/t/mutation-documentation-does-not-adequately-cover-ref-types/14900/1 "2021-07-09T17:46:09Z")

</div>

There is a single example in the graphql mutation documentation section that covers the usage of ref types, and it appears to be wrong. This is in addition to the generated mutations and their associated types not being covered in any detail whatsoever.

Questions this has caused that I haven’t been able to figure out the answers to after several hours of whacking at it:

- Why are non-id fields required to create a reference to an item?
- Why does submitting a reference to an object with an id create an item with that id, such that using upsert to add actual data to that item is required?
- What are the actual definitions of the ref types?

Thank you.

---

<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: [July 9, 2021, 7:03pm UTC](https://discuss.dgraph.io/t/mutation-documentation-does-not-adequately-cover-ref-types/14900/3 "2021-07-09T19:03:29Z")

</div>

Are you referring to this page:

> **[Deep Mutations - GraphQL](https://dgraph.io/docs/graphql/mutations/deep/)**
>
> You can perform deep mutations at multiple levels. Deep mutations do not alter linked objects, but they can add deeply-nested new objects or link to existing objects.

* * *

> [@Ben\_Holland](#):
>
> Why are non-id fields required to create a reference to an item?

That is not the case. Do you mind sharing your schema snippets? The only fields that should be required on a ref are any fields that have the `@id` directive.

> [@Ben\_Holland](#):
>
> Why does submitting a reference to an object with an id create an item with that id, such that using upsert to add actual data to that item is required?

First we have to correctly understand what you mean by `id`, do you mean a field with the type `ID` (equivalent to a Dgraph uid) or do you mean fields with `@id` directive? Yes, they behave differently.

> [@Ben\_Holland](#):
>
> What are the actual definitions of the ref types?

Not sure what you are asking for? Like what is the generated type definitions? If so, then you can inspect your GraphQL endpoint and see the type definitions.
