You are looking at the docs for the unreleased master branch of Dgraph. The latest version is v20.11.
Report Issue Edit Page

Index of Directives

The list of all directives supported by Dgraph.


@auth allows you to define how to apply authorization rules on the queries/mutation for a type.

Reference: Auth directive


@cascade allows you to filter out certain nodes within a query.

Reference: Cascade


@custom directive is used to define custom queries, mutations and fields.

Reference: Custom directive


@dgraph directive tells us how to map fields within a type to existing predicates inside Dgraph.

Reference: GraphQL on Existing Dgraph


The @generate directive is used to specify which GraphQL APIs are generated for a type.

Reference: Generate directive


@hasInverse is used to setup up two way edges such that adding a edge in one direction automically adds the one in the inverse direction.

Reference: Linking nodes in the graph


@id directive is used to annotate a field which represents a unique identifier coming from outside of Dgraph.

Reference: Identity


The @include directive can be used to include a field based on the value of an if argument.

Reference: Include directive


The @lambda directive allows you to call custom JavaScript resolvers. The @lambda queries, mutations, and fields are resolved through the lambda functions implemented on a given lambda server.

Reference: Lambda directive


@remote directive is used to annotate types for which data is not stored in Dgraph. These types are typically used with custom queries and mutations.

Reference: Remote directive

@search allows you to perform filtering on a field while querying for nodes.

Reference: Search


@secret directive is used to store secret information, it gets encrypted and then stored in Dgraph.

Reference: Password Type


The @skip directive can be used to fetch a field based on the value of a user-defined GraphQL variable.

Reference: Skip directive


@withSubscription directive when applied on a type, generates subsciption queries for it.

Reference: Subscriptions

Continue the conversation on Discuss.