Related entities
Some fields can refer to other entities. In this case, you can make a sub-selection of fields for that entity. GraphQL queries can traverse related entities and their fields, allowing you to retrieve related data in one request. The following example adds the asset parent domain and parent community to the initial basic query:
query {
assets {
id
fullName
domain {
name
parent {
name
}
}
}
}{
"data": {
"assets": [
{
"id": "00000000-0000-0000-0000-000000005015",
"fullName": "Community Manager",
"domain": {
"name": "Roles",
"parent": {
"name": "Admin Community"
}
}
}
]
}
}Some fields are collections and they can contain multiple related entities, for example a community can have multiple child domains:
query {
communities(limit: 1) {
name
subDomains(limit: 3) {
name
}
}
}{
"data": {
"communities": [
{
"name": "Admin Community",
"subDomains": [
{
"name": "System"
},
{
"name": "Workflow Definitions"
},
{
"name": "Complex Relations"
}
]
}
]
}
}Last updated
Was this helpful?