Skip to main content

List Entities of a Type in a Space

The most common curator query: show me every Project (or Person, or Topic) in this space. This is the hot pathentities(spaceId, typeId) is heavily indexed and fast even on large spaces.

Query

query ListByType($spaceId: UUID!, $typeId: UUID!, $first: Int = 100) {
entities(spaceId: $spaceId, typeId: $typeId, first: $first) {
id
name
description
}
}
{
"spaceId": "41e851610e13a19441c4d980f2f2ce6b",
"typeId": "484a18c5030a499cb0f2ef588ff16d50"
}

Response

{
"data": {
"entities": [
{ "id": "00d1d0a8b36b48ae9cb531e09dfbd5be", "name": "AVP", "description": null },
{ "id": "012b60596695419fa016590746e5a243", "name": "ONNX Runtime", "description": "..." },
{ "id": "013bdd03e0694181a8442055e3b1fe93", "name": "New York state", "description": null }
]
}
}
Loading interactive query runner…

Pagination version

For the connection-style query that gives you totalCount, pageInfo, and cursor-based pagination, use entitiesConnection:

query ListByTypePaged($spaceId: UUID!, $typeId: UUID!, $after: Cursor) {
entitiesConnection(spaceId: $spaceId, typeId: $typeId, first: 100, after: $after) {
totalCount
pageInfo { hasNextPage endCursor }
nodes { id name }
}
}

See Paginate large result sets for the full loop.

Common type IDs

These come from the SDK's SystemIds and ContentIds — match against any new schema with 02-discover-type-ids.ts:

TypeIDSource
Project484a18c5030a499cb0f2ef588ff16d50SystemIds.PROJECT_TYPE
Person7ed45f2bc48b419e8e4664d5ff680b0dSystemIds.PERSON_TYPE
Topic5ef5a5860f274d8e8f6c59ae5b3e89e2ContentIds.TOPIC_TYPE
Tag(see ContentIds)ContentIds.TAG_TYPE

Notes

  • entities(spaceId, typeId) is fast. It's a direct index lookup. Use this whenever you can.
  • entities(filter: { typeIds: { anyEqualTo: $typeId } }) is slow without a spaceId scoping — it can timeout on large connections. If you genuinely need cross-space, use search or query a few candidate spaces in parallel.
  • An entity can have multiple types. Filtering by one typeId returns entities that have at least that type; they may have others too.