Limits

To limit the amount of resources used by a single query, you can retrieve a maximum of 100,000 nodes in a single query. A query that can potentially return more than this limit is not executed and an error message is returned in the response:

{
  "errors": [
    {
      "message": "The query has exceeded the size limit. Your request is for 101000 fields, while the maximum limit is 100000 fields.",
      "locations": [
        {
          "line": -1,
          "column": -1
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    }
  ]
}

The number of nodes is calculated before executing the query and is based on limit parameters. The actual count of nodes that would be returned does not matter. This is to avoid that the query would succeed or fail depending on the data that is present in the system at a given point in time.

The number of nodes for a query is calculated as the number of root nodes multiplied by the total number of child nodes. The same calculation is applied recursively for each level of parent-child relationships in the query.

The following query can potentially return 195 nodes:

query {
    communities(limit: 3) {        # 195 = 3 * (1 + 64)
        name                       # 1
        subCommunities(limit: 4) { # 64 = 4 * (1 + 15)
            name                   # 1
            subDomains(limit: 5) { # 15 = 5 * (1 + 2)
                name               # 1
                createdBy {        # 2 = 1 * (1 + 1)
                    firstName      # 1
                    lastName       # 1
                }
            }
        }
    }
}

If you don’t specify a limit, the default value of 10 applies. The size of the following query is 110 nodes:

query {
    communities {    # 110 = 10 * (1 + 10)
        name         # 1
        subDomains { # 10 = 10 * 1
            name     # 1
        }
    }
}