Pagination

You can use the following arguments for every collection field to page the results:

Name Default value Description

limit

10

The maximum items to return

offset

0

The number of items to skip

To select communities from 5th to 10th, each with a maximum of two child domains, use the following query:

query {
    communities(limit: 5, offset: 5) {
        subDomains(limit: 2) {
            name
        }
    }
}

Offset-based pagination works well for the first pages, but using a very large offset will have a negative impact on performance. If you need to select many assets in small chunks it's better to achieve pagination using a where argument. For example, to fetch the first page, use:

query {
    assets(
        order: { id: asc }
        where: { id: { gt: "00000000-0000-0000-0000-000000000000" } }
    ) {
        id
        fullName
    }
}
{
  "data": {
    "assets": [
      {
        "id": "00000000-0000-0000-0000-000000008001",
        "fullName": "Data Quality Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008002",
        "fullName": "Data Policy Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008003",
        "fullName": "Data Definition Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008004",
        "fullName": "Completeness Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008005",
        "fullName": "Conformity Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008006",
        "fullName": "Consistency Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008007",
        "fullName": "Accuracy Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008008",
        "fullName": "Duplication Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008009",
        "fullName": "Integrity Issue"
      },
      {
        "id": "00000000-0000-0000-0000-000000008010",
        "fullName": "Policy non Compliance Issue"
      }
    ]
  }
}

For each of the next pages, use the ID of the last item in the where clause. In this example, with the default limit of 10 elements it's going to be 00000000-0000-0000-0000-000000008010.

query {
    assets(
        order: { id: asc }
        where: { id: { gt: "00000000-0000-0000-0000-000000008010" } }
    ) {
        id
        fullName
    }
}
{
  "data": {
    "assets": [
      {
        "id": "00000000-0000-0000-0000-000000008011",
        "fullName": "Policy Is Missing"
      },
      {
        "id": "00000000-0000-0000-0000-000000008012",
        "fullName": "Definition not Clear"
      },
      {
        "id": "00000000-0000-0000-0000-000000008013",
        "fullName": "Definition not Correct"
      },
      {
        "id": "00000000-0000-0000-0000-000000008014",
        "fullName": "Definition Is Missing"
      },
      {
        "id": "00000000-0000-0000-0000-000000008041",
        "fullName": "Completeness"
      },
      {
        "id": "00000000-0000-0000-0000-000000008042",
        "fullName": "Conformity"
      },
      {
        "id": "00000000-0000-0000-0000-000000008043",
        "fullName": "Consistency"
      },
      {
        "id": "00000000-0000-0000-0000-000000008044",
        "fullName": "Accuracy"
      },
      {
        "id": "00000000-0000-0000-0000-000000008045",
        "fullName": "Duplication"
      },
      {
        "id": "00000000-0000-0000-0000-000000008046",
        "fullName": "Integrity"
      }
    ]
  }
}