Retrieve Schema
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.
You can retrieve the Dgraph schema containing the list of predicates types and node types by:
- issuing a query on /query endpoint using the HTTP Client
- issuing a query using any DQL client library
- using Ratel UI
When using a query, the request body is
Unlike regular queries, the schema query isn’t surrounded by curly braces. Also, schema queries and regular queries can’t be combined.
You can query for particular schema fields in the query body.
You can also query for particular predicates:
If Access Control Lists (ACL) is enabled, then the schema query returns only the predicates for which the logged-in ACL user has read access.
Types can also be queried. Below are some example queries.
Note that type queries don’t contain anything between the curly braces. The output is the entire definition of the requested types.
Was this page helpful?