Introspection of dgraph does not yield 'upsert' arg in generated Mutation types

Report a GraphQL Bug

What edition and version of Dgraph are you using?


  • SlashGraphQL
  • Dgraph (community edition/Dgraph Cloud)

If you are using the community edition or enterprise edition of Dgraph, please list the version:

Dgraph Version
$ dgraph version
Dgraph version   : v21.03.1
Dgraph codename  : rocket-1
Dgraph SHA-256   : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
Commit SHA-1     : ea1cb5f35
Commit timestamp : 2021-06-17 20:38:11 +0530
Branch           : HEAD
Go version       : go1.16.2
jemalloc enabled : true

For Dgraph official documentation, visit
For discussions about Dgraph     , visit
For fully-managed Dgraph Cloud   , visit

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2021 Dgraph Labs, Inc.

Have you tried reproducing the issue with the latest release?


Steps to reproduce the issue (paste the query/schema if possible)

Introspect dgraph’s generated graphql schema using any introspection query/tool… e.g. I can introspect using graphql's getIntrospectionQuery or the WebStorm GraphQL plugin’s inbuilt introspector - both have the same problem.

The upsert arg as describe here: is missing in the types resulting from introspection.

This means that intellisense and associated tooling won’t allow the upsert arg in ‘add’ mutations when creating client-side graphql mutations.

Expected behaviour and actual result.

The upsert argument is included in the introspected Mutation type.

Actually - I just noticed that once I switched the type of the id from ID to String! @Id, then the upsert: Boolean arg was added to the add mutation!

Can I ask why there is a difference here?