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


The fragment keyword lets you define new fragments that can be referenced in a query, per the Fragments section of the GraphQL specification. Fragments allow for the reuse of common repeated selections of fields, reducing duplicated text in the DQL documents. Fragments can be nested inside fragments, but no cycles are allowed in such cases. For example:

curl -H "Content-Type: application/dql" localhost:8080/query -XPOST -d $'
query {
  debug(func: uid(1)) {
fragment TestFrag {
fragment TestFragB {
}' | python -m json.tool | less
Note GraphQL+- has been renamed to Dgraph Query Language (DQL). While application/dql is the preferred value for the Content-Type header, we will continue to support Content-Type: application/graphql+- to avoid making breaking changes.