We’re overhauling Dgraph’s docs to make them clearer and more approachable. If
you notice any issues during this transition or have suggestions, please
let us know.
@dgraph directive customizes the name of the types and predicates
generated in Dgraph when deploying a GraphQL Schema.
type <type> @dgraph(type: "TypeNameToUseInDgraph")controls what Dgraph type is used for a GraphQL type.field: SomeType @dgraph(pred: "DgraphPredicate")controls what Dgraph predicate is mapped to a GraphQL field.
name for both movie
names and people’s names. In this case you can map fields in two different
GraphQL types to the one Dgraph predicate.
In Dgraph’s current GraphQL implementation, if two fields are mapped to the
same Dgraph predicate, both should have the same
@search directive.