You are looking at the docs for an older version of Dgraph (v21.03). The latest version is v23.1.
Ask a Question

Deprecation

The @deprecated directive allows you to tag the schema definition of a field or enum value as deprecated with an optional reason.

When you use the @deprecated directive, GraphQL users can deprecate their use of the deprecated field or enum value. Most GraphQL tools and clients will pick up this notification and give you a warning if you try to use a deprecated field.

Example

For example, to mark oldField in the schema as deprecated:

type MyType {
  id: ID!
  oldField: String @deprecated(reason: "oldField is deprecated. Use newField instead.")
  newField: String
  deprecatedField: String @deprecated
}